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

Skip to content

Commit 3b52d2b

Browse files
committed
Remove redundant method, fix signature and add doc-string to draw_tex
1 parent 8be23b6 commit 3b52d2b

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,24 @@ def option_scale_image(self):
503503

504504
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
505505
"""
506+
Draw a TeX instance.
507+
508+
Parameters
509+
----------
510+
gc : `.GraphicsContextBase`
511+
The graphics context.
512+
x : float
513+
The x location of the text in display coords.
514+
y : float
515+
The y location of the text baseline in display coords.
516+
s : str
517+
The TeX text string.
518+
prop : `matplotlib.font_manager.FontProperties`
519+
The font properties.
520+
angle : float
521+
The rotation angle in degrees anti-clockwise.
522+
mtext : `matplotlib.text.Text`
523+
The original text object to be rendered.
506524
"""
507525
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
508526

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,9 @@ def draw_image(self, gc, x, y, im, transform=None):
693693
interp, w, h, fname_img))
694694
_writeln(self.fh, r"\end{pgfscope}")
695695

696-
def draw_tex(self, gc, x, y, s, prop, angle, ismath="TeX", mtext=None):
696+
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
697697
# docstring inherited
698-
self.draw_text(gc, x, y, s, prop, angle, ismath, mtext)
698+
self.draw_text(gc, x, y, s, prop, angle, ismath="TeX", mtext=mtext)
699699

700700
def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
701701
# docstring inherited

lib/matplotlib/backends/backend_svg.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,10 +1292,6 @@ def _get_all_quoted_names(prop):
12921292

12931293
writer.end('g')
12941294

1295-
def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
1296-
# docstring inherited
1297-
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
1298-
12991295
def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
13001296
# docstring inherited
13011297

0 commit comments

Comments
 (0)