pyvista.ChartPie.legend

Contents

pyvista.ChartPie.legend#

property ChartPie.legend[source]#

Return the chart’s legend.

Examples

Create a pie chart with custom labels and access its legend.

>>> import pyvista as pv
>>> chart = pv.ChartPie([5, 4, 3, 2, 1])
>>> chart.plot.labels = ["A", "B", "C", "D", "E"]
>>> legend = chart.legend
>>> chart.show()
../../../../_images/pyvista-ChartPie-legend-0326cbc968c94767_00_00.png