Skip to content

Commit 9531b8a

Browse files
committed
DOC: correct return type for axline [ci doc]
1 parent 92cc8f5 commit 9531b8a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def axline(self, xy1, xy2=None, *, slope=None, **kwargs):
895895
896896
Returns
897897
-------
898-
`.Line2D`
898+
`.AxLine`
899899
900900
Other Parameters
901901
----------------

lib/matplotlib/axes/_axes.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from matplotlib.contour import ContourSet, QuadContourSet
1717
from matplotlib.image import AxesImage, PcolorImage
1818
from matplotlib.legend import Legend
1919
from matplotlib.legend_handler import HandlerBase
20-
from matplotlib.lines import Line2D
20+
from matplotlib.lines import Line2D, AxLine
2121
from matplotlib.mlab import GaussianKDE
2222
from matplotlib.patches import Rectangle, FancyArrow, Polygon, StepPatch, Wedge
2323
from matplotlib.quiver import Quiver, QuiverKey, Barbs
@@ -150,7 +150,7 @@ class Axes(_AxesBase):
150150
*,
151151
slope: float | None = ...,
152152
**kwargs
153-
) -> Line2D: ...
153+
) -> AxLine: ...
154154
def axhspan(
155155
self, ymin: float, ymax: float, xmin: float = ..., xmax: float = ..., **kwargs
156156
) -> Polygon: ...

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
# We may not need the following imports here:
131131
from matplotlib.colors import Normalize
132-
from matplotlib.lines import Line2D
132+
from matplotlib.lines import Line2D, AxLine
133133
from matplotlib.text import Text, Annotation
134134
from matplotlib.patches import Polygon, Rectangle, Circle, Arrow
135135
from matplotlib.widgets import Button, Slider, Widget
@@ -2720,7 +2720,7 @@ def axline(
27202720
*,
27212721
slope: float | None = None,
27222722
**kwargs,
2723-
) -> Line2D:
2723+
) -> AxLine:
27242724
return gca().axline(xy1, xy2=xy2, slope=slope, **kwargs)
27252725

27262726

0 commit comments

Comments
 (0)