A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.axhline.html below:

matplotlib.pyplot.axhline — Matplotlib 3.10.5 documentation

matplotlib.pyplot.axhline#
matplotlib.pyplot.axhline(y=0, xmin=0, xmax=1, **kwargs)[source]#

Add a horizontal line spanning the whole or fraction of the Axes.

Note: If you want to set x-limits in data coordinates, use hlines instead.

Parameters:
yfloat, default: 0

y position in data coordinates.

xminfloat, default: 0

The start x-position in axes coordinates. Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.

xmaxfloat, default: 1

The end x-position in axes coordinates. Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.

Returns:
Line2D

A Line2D specified via two points (xmin, y), (xmax, y). Its transform is set such that x is in axes coordinates and y is in data coordinates.

This is still a generic line and the horizontal character is only realized through using identical y values for both points. Thus, if you want to change the y value later, you have to provide two values line.set_ydata([3, 3]).

Other Parameters:
**kwargs

Valid keyword arguments are Line2D properties, except for 'transform':

See also

hlines

Add horizontal lines in data coordinates.

axhspan

Add a horizontal span (rectangle) across the axis.

axline

Add a line with an arbitrary slope.

Notes

Examples

Examples using matplotlib.pyplot.axhline#

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4