Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Backport PR #28943 on branch v3.9.x (DOC: Clarify the returned line of axhline()/axvline()) #28945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
Returns
-------
`~matplotlib.lines.Line2D`
A `.Line2D` specified via two points ``(xmin, y)``, ``(xmax, y)``.
Its transform is set such that *x* is in
:ref:`axes coordinates <coordinate-systems>` and *y* is in
:ref:`data coordinates <coordinate-systems>`.

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
----------------
Expand Down Expand Up @@ -852,6 +861,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
Returns
-------
`~matplotlib.lines.Line2D`
A `.Line2D` specified via two points ``(x, ymin)``, ``(x, ymax)``.
Its transform is set such that *x* is in
:ref:`data coordinates <coordinate-systems>` and *y* is in
:ref:`axes coordinates <coordinate-systems>`.

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

Other Parameters
----------------
Expand Down
Loading