Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b2a2ed1

Browse files
committed
Remove deprecated *ismath* parameter of draw_tex.
1 parent a61f208 commit b2a2ed1

7 files changed

Lines changed: 18 additions & 15 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*ismath* parameter of ``draw_tex``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
The *ismath* parameter of the ``draw_tex`` method of all renderer classes has
4+
been removed (as a call to ``draw_tex`` -- not to be confused with
5+
``draw_text``! -- means that the entire string should be passed to the
6+
``usetex`` machinery anyways). Likewise, the text machinery will no longer pass
7+
the *ismath* parameter when calling ``draw_tex`` (this should only matter for
8+
backend implementers).
9+
10+
Passing ``ismath="TeX!"`` to `.RendererAgg.get_text_width_height_descent` is no
11+
longer supported; pass ``ismath="TeX"`` instead,

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,7 @@ def option_scale_image(self):
522522
"""
523523
return False
524524

525-
@_api.delete_parameter("3.3", "ismath")
526-
def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
525+
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
527526
"""
528527
"""
529528
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")

lib/matplotlib/backends/backend_agg.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
217217
def get_text_width_height_descent(self, s, prop, ismath):
218218
# docstring inherited
219219

220-
if ismath in ["TeX", "TeX!"]:
221-
if ismath == "TeX!":
222-
_api.warn_deprecated(
223-
"3.3", message="Support for ismath='TeX!' is deprecated "
224-
"since %(since)s and will be removed %(removal)s; use "
225-
"ismath='TeX' instead.")
220+
_api.check_in_list(["TeX", True, False], ismath=ismath)
221+
if ismath == "TeX":
226222
# todo: handle props
227223
texmanager = self.get_texmanager()
228224
fontsize = prop.get_size_in_points()

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,8 +2156,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle):
21562156
# Pop off the global transformation
21572157
self.file.output(Op.grestore)
21582158

2159-
@_api.delete_parameter("3.3", "ismath")
2160-
def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
2159+
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
21612160
# docstring inherited
21622161
texmanager = self.get_texmanager()
21632162
fontsize = prop.get_size_in_points()

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def draw_image(self, gc, x, y, im, transform=None):
668668
interp, w, h, fname_img))
669669
writeln(self.fh, r"\end{pgfscope}")
670670

671-
def draw_tex(self, gc, x, y, s, prop, angle, ismath="TeX!", mtext=None):
671+
def draw_tex(self, gc, x, y, s, prop, angle, ismath="TeX", mtext=None):
672672
# docstring inherited
673673
self.draw_text(gc, x, y, s, prop, angle, ismath, mtext)
674674

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
548548

549549
self._path_collection_id += 1
550550

551-
@_api.delete_parameter("3.3", "ismath")
552-
def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
551+
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
553552
# docstring inherited
554553
if not hasattr(self, "psfrag"):
555554
_log.warning(

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,8 +1217,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
12171217

12181218
writer.end('g')
12191219

1220-
@_api.delete_parameter("3.3", "ismath")
1221-
def draw_tex(self, gc, x, y, s, prop, angle, ismath='TeX!', mtext=None):
1220+
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
12221221
# docstring inherited
12231222
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
12241223

0 commit comments

Comments
 (0)