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

Skip to content

Commit d6c7c75

Browse files
committed
Fixes for text.usetex mode provided by Jae-Joon.
1 parent 1d1d039 commit d6c7c75

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/matplotlib/backends/backend_svg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath):
986986
writer.end('g')
987987

988988
def draw_tex(self, gc, x, y, s, prop, angle):
989-
self.draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
989+
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
990990

991991
def draw_text(self, gc, x, y, s, prop, angle, ismath):
992992
clipid = self._get_clip(gc)

lib/matplotlib/textpath.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_text_width_height_descent(self, s, prop, ismath):
7676
texmanager = self.get_texmanager()
7777
fontsize = prop.get_size_in_points()
7878
w, h, d = texmanager.get_text_width_height_descent(s, fontsize,
79-
renderer=self)
79+
renderer=None)
8080
return w, h, d
8181

8282
fontsize = prop.get_size_in_points()
@@ -130,10 +130,10 @@ def get_text_path(self, prop, s, ismath=False, usetex=False):
130130

131131
for glyph_id, xposition, yposition, scale in glyph_info:
132132
verts1, codes1 = glyph_map[glyph_id]
133-
if verts1:
133+
if len(verts1):
134134
verts1 = np.array(verts1)*scale + [xposition, yposition]
135-
verts.extend(verts1)
136-
codes.extend(codes1)
135+
verts.extend(verts1)
136+
codes.extend(codes1)
137137

138138
for verts1, codes1 in rects:
139139
verts.extend(verts1)

0 commit comments

Comments
 (0)