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

Appearance settings

Commit 6d85a30

Browse filesBrowse files
authored
Merge pull request #16772 from timhoffm/remove-3.1-deprecations6
Remove more API deprecated in 3.1
2 parents 1632a53 + 567bf46 commit 6d85a30
Copy full SHA for 6d85a30

File tree

Expand file treeCollapse file tree

5 files changed

+10
-86
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+10
-86
lines changed

‎doc/api/next_api_changes/removals.rst

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/removals.rst
+10-2Lines 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.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

Copy file name to clipboardExpand all lines: lib/matplotlib/spines.py
-22Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -240,28 +240,6 @@ def cla(self):
240240
if self.axis is not None:
241241
self.axis.cla()
242242

243-
@cbook.deprecated("3.1")
244-
def is_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-
if isinstance(position, str):
253-
if position == 'center':
254-
position = ('axes', 0.5)
255-
elif position == 'zero':
256-
position = ('data', 0)
257-
if len(position) != 2:
258-
raise ValueError("position should be 2-tuple")
259-
position_type, amount = position
260-
if position_type == 'outward' and amount == 0:
261-
return True
262-
else:
263-
return False
264-
265243
def _adjust_location(self):
266244
"""Automatically set spine bounds to the view interval."""
267245

‎lib/matplotlib/text.py

Copy file name to clipboardExpand all lines: lib/matplotlib/text.py
-24Lines 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-
def is_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-
if usetex is None:
1190-
usetex = rcParams['text.usetex']
1191-
if usetex:
1192-
if s == ' ':
1193-
s = r'\ '
1194-
return s, 'TeX'
1195-
1196-
if cbook.is_math_text(s):
1197-
return s, True
1198-
else:
1199-
return s.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

Copy file name to clipboardExpand all lines: lib/matplotlib/textpath.py
-33Lines 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-
def is_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 > 0 and dollar_count % 2 == 0)
468-
469-
if rcParams['text.usetex']:
470-
return s, 'TeX'
471-
472-
if even_dollars:
473-
return s, True
474-
else:
475-
return s.replace(r'\$', '$'), False
476-
477-
@cbook.deprecated("3.1", alternative="TextPath")
478-
def text_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-
if usetex:
485-
return text_to_path.get_text_path(prop, s, usetex=True)
486-
else:
487-
clean_line, ismath = self.is_math_text(s)
488-
return text_to_path.get_text_path(prop, clean_line, ismath=ismath)

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,11 +1816,6 @@ def _release(self, event):
18161816
self.pressv = None
18171817
return False
18181818

1819-
@cbook.deprecated("3.1")
1820-
@property
1821-
def buttonDown(self):
1822-
return False
1823-
18241819
def _onmove(self, event):
18251820
"""on motion notify event"""
18261821
if self.pressv is None:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.