matplotlib.axes.Axes.vlines#

Axes.vlines(x, ymin, ymax, colors=None, linestyles='solid', label='', *, data=None, **kwargs)[source]#

Plot vertical lines at each x from ymin to ymax.

Parameters:
xfloat or array-like

x-indexes where to plot the lines.

ymin, ymaxfloat or array-like

Respective beginning and end of each line. If scalars are provided, all lines will have the same length.

colorslist of colors, default: rcParams["lines.color"] (default: 'C0')
linestyles{'solid', 'dashed', 'dashdot', 'dotted'}, optional
labelstr, default: ''
Returns:
LineCollection
Other Parameters:
dataindexable object, optional

If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):

x, ymin, ymax, colors

**kwargsLineCollection properties.

See also

hlines

horizontal lines

axvline

vertical line across the Axes

Examples using matplotlib.axes.Axes.vlines#

Creating a timeline with lines, dates, and text

Creating a timeline with lines, dates, and text

Creating a timeline with lines, dates, and text
hlines and vlines

hlines and vlines

hlines and vlines
Violin plot customization

Violin plot customization

Violin plot customization
Angle annotations on bracket arrows

Angle annotations on bracket arrows

Angle annotations on bracket arrows