remove_legend#

Renderer.remove_legend(render=True)[source]#

Remove the legend actor.

Parameters
renderbool, optional

Render upon actor removal. Set this to False to stop the render window from rendering when a the legend is removed.

Examples

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> pl = pyvista.Plotter()
>>> _ = pl.add_mesh(mesh, label='sphere')
>>> _ = pl.add_legend()
>>> pl.remove_legend()
../../../_images/pyvista-Renderer-remove_legend-1_00_00.png