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

Skip to content

Commit ea41be3

Browse files
committed
DOC: Clarify the returned line of axhline()/axvline()
Closes #28927.
1 parent 60458da commit ea41be3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,15 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
754754
Returns
755755
-------
756756
`~matplotlib.lines.Line2D`
757+
A `.Line2D` specified via two points ``(xmin, y)``, ``(xmax, y)``.
758+
Its transform is set such that *x* is in
759+
:ref:`axes coordinates <coordinate-systems>` and *y* is in
760+
:ref:`data coordinates <coordinate-systems>`.
761+
762+
This is still a generic line and the horizontal character is only
763+
realized through using identical *y* values for both points. Thus,
764+
if you want to change the *y* value later, you have to provide two
765+
values ``line.set_ydata([3, 3])``.
757766
758767
Other Parameters
759768
----------------
@@ -828,6 +837,15 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
828837
Returns
829838
-------
830839
`~matplotlib.lines.Line2D`
840+
A `.Line2D` specified via two points ``(x, ymin)``, ``(x, ymax)``.
841+
Its transform is set such that *x* is in
842+
:ref:`data coordinates <coordinate-systems>` and *y* is in
843+
:ref:`axes coordinates <coordinate-systems>`.
844+
845+
This is still a generic line and the vertical character is only
846+
realized through using identical *x* values for both points. Thus,
847+
if you want to change the *x* value later, you have to provide two
848+
values ``line.set_xdata([3, 3])``.
831849
832850
Other Parameters
833851
----------------

0 commit comments

Comments
 (0)