pyvista.ChartBox.legend_visible#

property ChartBox.legend_visible[source]#

Return or set the visibility of the chart’s legend.

Examples

Create a boxplot chart with custom labels.

>>> import pyvista
>>> chart = pyvista.ChartBox([[0, 1, 1, 2, 3, 3, 4]])
>>> chart.plot.label = "Data label"
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/94f60e73d2f8cddd4de33f0fe8f1cde09641ed70/e32de/_images/pyvista-chartbox-legend_visible-1_00_00.png

Hide the legend.

>>> chart.legend_visible = False
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/4645fb8bcb29b53ec5478c26dd847fc89c8aecc1/7e517/_images/pyvista-chartbox-legend_visible-1_01_00.png