pyvista.plotting.charts.BarPlot.labels#

property BarPlot.labels[source]#

Return or set the this plot’s labels, as shown in the chart’s legend.

Examples

Create a bar plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.bar([1, 2, 3], [[2, 1, 3], [1, 0, 2], [0, 3, 1], [3, 2, 0]])
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/5cf83e850ec4383ca836be87d2e6ee098a4c7f2b/4deae/_images/pyvista-plotting-charts-barplot-labels-1_00_00.png

Modify the labels.

>>> plot.labels = ["A", "B", "C", "D"]
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/c6cf80238bee0e2151de176c179ac28c654cf702/3d8e8/_images/pyvista-plotting-charts-barplot-labels-1_01_00.png