Skip to content

Commit

Permalink
Merge pull request #27506 from meeseeksmachine/auto-backport-of-pr-27…
Browse files Browse the repository at this point in the history
…504-on-v3.8.x

Backport PR #27504 on branch v3.8.x (DOC: correct return type for axline)
  • Loading branch information
oscargus committed Dec 12, 2023
2 parents 11ee6db + 8b40424 commit 93a8cfe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def axline(self, xy1, xy2=None, *, slope=None, **kwargs):
Returns
-------
`.Line2D`
`.AxLine`
Other Parameters
----------------
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/axes/_axes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ from matplotlib.contour import ContourSet, QuadContourSet
from matplotlib.image import AxesImage, PcolorImage
from matplotlib.legend import Legend
from matplotlib.legend_handler import HandlerBase
from matplotlib.lines import Line2D
from matplotlib.lines import Line2D, AxLine
from matplotlib.mlab import GaussianKDE
from matplotlib.patches import Rectangle, FancyArrow, Polygon, StepPatch, Wedge
from matplotlib.quiver import Quiver, QuiverKey, Barbs
Expand Down Expand Up @@ -151,7 +151,7 @@ class Axes(_AxesBase):
*,
slope: float | None = ...,
**kwargs
) -> Line2D: ...
) -> AxLine: ...
def axhspan(
self, ymin: float, ymax: float, xmin: float = ..., xmax: float = ..., **kwargs
) -> Polygon: ...
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

# We may not need the following imports here:
from matplotlib.colors import Normalize
from matplotlib.lines import Line2D
from matplotlib.lines import Line2D, AxLine
from matplotlib.text import Text, Annotation
from matplotlib.patches import Polygon, Rectangle, Circle, Arrow
from matplotlib.widgets import Button, Slider, Widget
Expand Down Expand Up @@ -2721,7 +2721,7 @@ def axline(
*,
slope: float | None = None,
**kwargs,
) -> Line2D:
) -> AxLine:
return gca().axline(xy1, xy2=xy2, slope=slope, **kwargs)


Expand Down

0 comments on commit 93a8cfe

Please sign in to comment.