Skip to content

Commit fc4da30

Browse files
committed
Fix organization
1 parent c21a83d commit fc4da30

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

lib/matplotlib/axes/_axes.pyi

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from matplotlib.axes._base import _AxesBase
1+
from matplotlib.axes._base import _AxesBase, _coords_type
22
from matplotlib.axes._secondary_axes import SecondaryAxis
33

44
from matplotlib.artist import Artist
@@ -22,7 +22,7 @@ from matplotlib.mlab import GaussianKDE
2222
from matplotlib.patches import Rectangle, FancyArrow, Polygon, StepPatch, Wedge
2323
from matplotlib.quiver import Quiver, QuiverKey, Barbs
2424
from matplotlib.text import Annotation, Text
25-
from matplotlib.transforms import Transform, Bbox
25+
from matplotlib.transforms import Transform
2626
import matplotlib.tri as mtri
2727
import matplotlib.table as mtable
2828
import matplotlib.stackplot as mstack
@@ -36,11 +36,6 @@ import numpy as np
3636
from numpy.typing import ArrayLike
3737
from matplotlib.typing import ColorType, MarkerType, LineStyleType
3838

39-
_coords_type_base = (
40-
str | Artist | Transform | Callable[[RendererBase], Bbox | Transform]
41-
)
42-
_coords_type = _coords_type_base | tuple[_coords_type_base, _coords_type_base]
43-
4439
class Axes(_AxesBase):
4540
def get_title(self, loc: Literal["left", "center", "right"] = ...) -> str: ...
4641
def set_title(

lib/matplotlib/axes/_base.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
from operator import attrgetter
88
import re
99
import types
10+
from typing import Callable
1011

1112
import numpy as np
1213

1314
import matplotlib as mpl
1415
from matplotlib import _api, cbook, _docstring, offsetbox
1516
import matplotlib.artist as martist
1617
import matplotlib.axis as maxis
18+
from matplotlib import backend_bases
1719
from matplotlib.cbook import _OrderedSet, _check_1d, index_of
1820
import matplotlib.collections as mcoll
1921
import matplotlib.colors as mcolors
@@ -32,6 +34,15 @@
3234
_log = logging.getLogger(__name__)
3335

3436

37+
_coords_type_base = (
38+
str |
39+
martist.Artist |
40+
mtransforms.Transform |
41+
Callable[[backend_bases.RendererBase], mtransforms.Bbox | mtransforms.Transform]
42+
)
43+
_coords_type = _coords_type_base | tuple[_coords_type_base, _coords_type_base]
44+
45+
3546
class _axis_method_wrapper:
3647
"""
3748
Helper to generate Axes methods wrapping Axis methods.

lib/matplotlib/offsetbox.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import matplotlib.artist as martist
2-
from matplotlib.axes._axes import _coords_type
2+
from matplotlib.axes._base import _coords_type
33
from matplotlib.backend_bases import RendererBase, Event, FigureCanvasBase
44
from matplotlib.colors import Colormap, Normalize
55
import matplotlib.text as mtext

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
import matplotlib.artist
9595
import matplotlib.backend_bases
9696
from matplotlib.axis import Tick
97-
from matplotlib.axes._base import _AxesBase
97+
from matplotlib.axes._base import _AxesBase, _coords_type
9898
from matplotlib.backend_bases import RendererBase, Event
9999
from matplotlib.cm import ScalarMappable
100100
from matplotlib.contour import ContourSet, QuadContourSet

lib/matplotlib/text.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .artist import Artist
2-
from .axes._axes import _coords_type
2+
from .axes._base import _coords_type
33
from .backend_bases import RendererBase
44
from .font_manager import FontProperties
55
from .offsetbox import DraggableAnnotation

0 commit comments

Comments
 (0)