You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.0.2.post2268+g9f891c621
Fork me on GitHub


matplotlib.pyplot.hlines(y, xmin, xmax, colors='k', linestyles='solid', label='', *, data=None, **kwargs)[source]

Plot horizontal lines at each y from xmin to xmax.

y : scalar or sequence of scalar

y-indexes where to plot the lines.

xmin, xmax : 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 : string, optional, default: ''
lines : LineCollection
Other Parameters:
**kwargs : LineCollection properties.

See also

vertical lines
horizontal line across the axes
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', 'xmax', 'xmin', 'y'. Objects passed as data must support item access (data[<arg>]) and membership test (<arg> in data).