pyvista.Renderer.set_background#
- Renderer.set_background(color, top=None, right=None, side=None, corner=None)[source]#
- Set the background color of this renderer. - Parameters:
- colorColorLike,optional
- Either a string, rgb list, or hex color string. Defaults to theme default. For example: - color='white'
- color='w'
- color=[1.0, 1.0, 1.0]
- color='#FFFFFF'
 
- topColorLike,optional
- If given, this will enable a gradient background where the - colorargument is at the bottom and the color given in- topwill be the color at the top of the renderer.
- rightColorLike,optional
- If given, this will enable a gradient background where the - colorargument is at the left and the color given in- rightwill be the color at the right of the renderer.
- sideColorLike,optional
- If given, this will enable a gradient background where the - colorargument is at the center and the color given in- sidewill be the color at the side of the renderer.
- cornerColorLike,optional
- If given, this will enable a gradient background where the - colorargument is at the center and the color given in- cornerwill be the color at the corner of the renderer.
 
- color
 - Examples - Set the background color to black with a gradient to white at the top of the plot. - >>> import pyvista as pv >>> pl = pv.Plotter() >>> actor = pl.add_mesh(pv.Cone()) >>> pl.set_background('black', top='white') >>> pl.show() 