hlines
- mdtools.plot.hlines(ax, y, start, stop, xmin=None, xmax=None, ymin=None, ymax=None, legend_loc='best', **kwargs)[source]
Plot horizontal lines at each y from start to stop into a
matplotlib.axes.Axes
object usingmatplotlib.axes.Axes.hlines()
.Deprecated since version 0.0.0.dev2: Use
matplotlib.axes.Axes.hlines()
,matplotlib.axes.Axes.set()
andmatplotlib.axes.Axes.legend()
directly.- Parameters:
ax (
matplotlib.axes.Axes
) – The axes to draw to.y (
scalar
orarray_like
) – y-indices where to plot the lines.start, stop (
scalar
orarray_like
) – Respective beginning and end of each line. If scalars are provided, all lines will have same length.xmin (
scalar
, optional) – Left limit for plotting on x-axis. The left limit may be greater than the right limit, in which case the tick values will show up in decreasing order. Default isNone
, which means set the limit automatically.xmax (
scalar
, optional) – Right limit for plotting on x-axis.ymin, ymax (
scalar
, optional) – Same as xmin and xmax, but for the y-axis.legend_loc (
int
orstr
, optional) – Position of the legend. Seematplotlib.pyplot.legend()
for possible arguments.kwargs (
dict
, optional) – Keyword arguments to pass tomatplotlib.axes.Axes.hlines()
. See there for possible keyword arguments.
- Returns:
img (
matplotlib.collections.LineCollection
) – Amatplotlib.collections.LineCollection
.