Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit9fced56

Browse files
committed
Deprecate incorrect import locations
1 parentd7ffff2 commit9fced56

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Alternative import location for ``TextPath`` and ``AxislineStyle``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
These two classes have historically sometimes been imported from incorrect
5+
locations. This is now deprecated and `.TextPath` should be imported from
6+
`matplotlib.textpath`, while `AxislineStyle` should be imported from
7+
`mpl_toolkit.axisartist.axisline_style`.

‎lib/matplotlib/text.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@
1515
from .artistimportArtist
1616
from .font_managerimportFontProperties
1717
from .patchesimportFancyArrowPatch,FancyBboxPatch,Rectangle
18-
from .textpathimportTextPath# Unused, but imported by others.
18+
from .textpathimportTextPathas_TextPath# Unused, but imported by others.
1919
from .transformsimport (
2020
Affine2D,Bbox,BboxBase,BboxTransformTo,IdentityTransform,Transform)
2121

2222

2323
_log=logging.getLogger(__name__)
2424

2525

26+
@_api.deprecated("3.6",message="Since %(since)s, %(name)s should be imported "
27+
"from its correct module: matplotlib.textpath")
28+
classTextPath(_TextPath):
29+
pass
30+
31+
2632
@_api.deprecated("3.6")
2733
defget_rotation(rotation):
2834
"""

‎lib/mpl_toolkits/axes_grid1/anchored_artists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DrawingArea,TextArea,VPacker)
44
frommatplotlib.patchesimport (Rectangle,Ellipse,ArrowStyle,
55
FancyArrowPatch,PathPatch)
6-
frommatplotlib.textimportTextPath
6+
frommatplotlib.textpathimportTextPath
77

88
__all__= ['AnchoredDrawingArea','AnchoredAuxTransformBox',
99
'AnchoredEllipse','AnchoredSizeBar','AnchoredDirectionArrows']

‎lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,17 @@
4646
importmatplotlib.axesasmaxes
4747
frommatplotlib.pathimportPath
4848
frommpl_toolkits.axes_grid1importmpl_axes
49-
from .axisline_styleimportAxislineStyle
49+
from .axisline_styleimportAxislineStyleas_AxislineStyle
5050
from .axis_artistimportAxisArtist,GridlinesCollection
5151

5252

53+
@_api.deprecated("3.6",message="Since %(since)s, %(name)s should be imported "
54+
"from its correct module: "
55+
"mpl_toolkits.axisartist.axisline_style")
56+
classAxislineStyle(_AxislineStyle):
57+
pass
58+
59+
5360
classAxisArtistHelper:
5461
"""
5562
AxisArtistHelper should define

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp