Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d442ca8

Browse filesBrowse files
authored
Merge pull request #28943 from timhoffm/doc-axhvline
DOC: Clarify the returned line of axhline()/axvline()
2 parents 8e9ca92 + ea41be3 commit d442ca8
Copy full SHA for d442ca8

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+18Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.