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

Commit4618298

Browse files
committed
Remove more API deprecated in 3.1
1 parent2f6a7a4 commit4618298

File tree

5 files changed

+10
-86
lines changed

5 files changed

+10
-86
lines changed

‎doc/api/next_api_changes/removals.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ Classes and methods
7373
- ``scale.NaturalLogTransform`` (use ``scale.LogTransform`` instead)
7474
- ``scale.InvertedNaturalLogTransform`` (use ``scale.InvertedLogTransform`` instead)
7575

76+
- ``spines.Spine.is_frame_like()`` (no replacement)
77+
78+
- ``text.is_math_text()`` (use ``cbook.is_math_text()`` instead)
79+
- ``text.TextWithDash()`` (use ``text.Annotation`` instead)
80+
- ``textpath.TextPath.is_math_text()`` (use ``cbook.is_math_text()`` instead)
81+
- ``textpath.TextPath.text_get_vertices_codes()``
82+
(use ``textpath.text_to_path.get_text_path()`` instead)
83+
7684
- ``ticker.OldScalarFormatter.pprint_val()`` (no replacement)
7785
- ``ticker.ScalarFormatter.pprint_val()`` (no replacement)
7886
- ``ticker.LogFormatter.pprint_val()`` (no replacement)
@@ -112,8 +120,6 @@ Classes and methods
112120
- ``path.get_paths_extents()``
113121
(use ``path.get_path_collection_extents()`` instead)
114122

115-
- ``text.TextWithDash`` (use ``text.Annotation`` instead)
116-
117123
- ``mplot3d.proj3d.line2d()`` (no replacement)
118124
- ``mplot3d.proj3d.line2d_dist()`` (no replacement)
119125
- ``mplot3d.proj3d.line2d_seg_dist()`` (no replacement)
@@ -142,6 +148,8 @@ Classes and methods
142148
- ``axisartist.axislines.Axes.AxisDict``
143149
(use ``axis_grid1.mpl_axes.Axes.AxisDict`` instead)
144150

151+
- ``widgets.SpanSelector.buttonDown`` property (no replacement)
152+
145153
Arguments
146154
~~~~~~~~~
147155
- ``Axes.text()`` / ``pyplot.text()`` do not support the parameter ``withdash``

‎lib/matplotlib/spines.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -240,28 +240,6 @@ def cla(self):
240240
ifself.axisisnotNone:
241241
self.axis.cla()
242242

243-
@cbook.deprecated("3.1")
244-
defis_frame_like(self):
245-
"""Return True if directly on axes frame.
246-
247-
This is useful for determining if a spine is the edge of an
248-
old style MPL plot. If so, this function will return True.
249-
"""
250-
self._ensure_position_is_set()
251-
position=self._position
252-
ifisinstance(position,str):
253-
ifposition=='center':
254-
position= ('axes',0.5)
255-
elifposition=='zero':
256-
position= ('data',0)
257-
iflen(position)!=2:
258-
raiseValueError("position should be 2-tuple")
259-
position_type,amount=position
260-
ifposition_type=='outward'andamount==0:
261-
returnTrue
262-
else:
263-
returnFalse
264-
265243
def_adjust_location(self):
266244
"""Automatically set spine bounds to the view interval."""
267245

‎lib/matplotlib/text.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,30 +1174,6 @@ def set_text(self, s):
11741174
self._text=str(s)
11751175
self.stale=True
11761176

1177-
@staticmethod
1178-
@cbook.deprecated("3.1")
1179-
defis_math_text(s,usetex=None):
1180-
"""
1181-
Returns a cleaned string and a boolean flag.
1182-
The flag indicates if the given string *s* contains any mathtext,
1183-
determined by counting unescaped dollar signs. If no mathtext
1184-
is present, the cleaned string has its dollar signs unescaped.
1185-
If usetex is on, the flag always has the value "TeX".
1186-
"""
1187-
# Did we find an even number of non-escaped dollar signs?
1188-
# If so, treat is as math text.
1189-
ifusetexisNone:
1190-
usetex=rcParams['text.usetex']
1191-
ifusetex:
1192-
ifs==' ':
1193-
s=r'\ '
1194-
returns,'TeX'
1195-
1196-
ifcbook.is_math_text(s):
1197-
returns,True
1198-
else:
1199-
returns.replace(r'\$','$'),False
1200-
12011177
def_preprocess_math(self,s):
12021178
"""
12031179
Return the string *s* after mathtext preprocessing, and the kind of

‎lib/matplotlib/textpath.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -453,36 +453,3 @@ def _revalidate_path(self):
453453
.translate(*self._xy))
454454
self._cached_vertices=tr.transform(self._vertices)
455455
self._invalid=False
456-
457-
@cbook.deprecated("3.1")
458-
defis_math_text(self,s):
459-
"""
460-
Returns True if the given string *s* contains any mathtext.
461-
"""
462-
# copied from Text.is_math_text -JJL
463-
464-
# Did we find an even number of non-escaped dollar signs?
465-
# If so, treat is as math text.
466-
dollar_count=s.count(r'$')-s.count(r'\$')
467-
even_dollars= (dollar_count>0anddollar_count%2==0)
468-
469-
ifrcParams['text.usetex']:
470-
returns,'TeX'
471-
472-
ifeven_dollars:
473-
returns,True
474-
else:
475-
returns.replace(r'\$','$'),False
476-
477-
@cbook.deprecated("3.1",alternative="TextPath")
478-
deftext_get_vertices_codes(self,prop,s,usetex):
479-
"""
480-
Convert string *s* to a (vertices, codes) pair using font property
481-
*prop*.
482-
"""
483-
# Mostly copied from backend_svg.py.
484-
ifusetex:
485-
returntext_to_path.get_text_path(prop,s,usetex=True)
486-
else:
487-
clean_line,ismath=self.is_math_text(s)
488-
returntext_to_path.get_text_path(prop,clean_line,ismath=ismath)

‎lib/matplotlib/widgets.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,11 +1821,6 @@ def _release(self, event):
18211821
self.pressv=None
18221822
returnFalse
18231823

1824-
@cbook.deprecated("3.1")
1825-
@property
1826-
defbuttonDown(self):
1827-
returnFalse
1828-
18291824
def_onmove(self,event):
18301825
"""on motion notify event"""
18311826
ifself.pressvisNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp