You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.1.0.post1496+gb03370a04
matplotlib
Fork me on GitHub

matplotlib.pyplot.vlines

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

Plot vertical lines.

Plot vertical lines at each x from ymin to ymax.

Parameters:
x : scalar or 1D array-like

x-indexes where to plot the lines.

ymin, ymax : scalar or 1D array-like

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

colors : array-like of colors, optional, default: 'k'
linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, optional
label : str, optional, default: ''
Returns:
lines : LineCollection
Other Parameters:
**kwargs : LineCollection properties.

See also

hlines
horizontal lines
axvline
vertical line across the axes

Notes

Note

In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:

  • All arguments with the following names: 'colors', 'x', 'ymax', 'ymin'.

Objects passed as data must support item access (data[<arg>]) and membership test (<arg> in data).