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

Skip to content

Commit f05753d

Browse files
committed
backend_pgf: \pgftext now requires \color inside argument (fix #3779)
1 parent 86ec1b6 commit f05753d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
638638
# prepare string for tex
639639
s = common_texification(s)
640640
prop_cmds = _font_properties_str(prop)
641-
s = r"{%s %s}" % (prop_cmds, s)
641+
s = r"%s %s" % (prop_cmds, s)
642642

643643

644644
writeln(self.fh, r"\begin{pgfscope}")
@@ -652,6 +652,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
652652
writeln(self.fh, r"\definecolor{textcolor}{rgb}{%f,%f,%f}" % rgb)
653653
writeln(self.fh, r"\pgfsetstrokecolor{textcolor}")
654654
writeln(self.fh, r"\pgfsetfillcolor{textcolor}")
655+
s = r"\color{textcolor}" + s
655656

656657
f = 1.0 / self.figure.dpi
657658
text_args = []

0 commit comments

Comments
 (0)