bar#, y, color=None, orientation='V', label=None)[source]#

Add a bar plot to this chart.


Positions (along the x-axis for a vertical orientation, along the y-axis for a horizontal orientation) of the bars to draw.


Size of the bars to draw. Multiple bars can be stacked by passing a sequence of sequences.

colorcolor_like, optional

Color of the bars drawn in this plot. Any color parsable by pyvista.Color is allowed. Defaults to "b".

orientationstr, optional

Orientation of the bars drawn in this plot. Either "H" for an horizontal orientation or "V" for a vertical orientation. Defaults to "V".

labelstr, optional

Label of this plot, as shown in the chart’s legend. Defaults to "".


The created bar plot.


Generate a bar plot.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot =[0, 1, 2], [2, 1, 3])