You are reading an old version of the documentation (v2.1.2). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hlines.html
Version 2.1.2
matplotlib
Fork me on GitHub


Travis-CI:

This Page

matplotlib.pyplot.hlines

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

Plot horizontal lines at each y from xmin to xmax.

Parameters:

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: ‘’

Returns:

lines : LineCollection

Other Parameters:
 

**kwargs : LineCollection properties.

See also

vlines
vertical lines
axhline
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’.