Skip to content

Commit 58b24e0

Browse files
committed
PGF backend output text color even if black
1 parent 991f996 commit 58b24e0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,10 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
673673
writeln(self.fh, r"\pgfsetfillopacity{%f}" % alpha)
674674
writeln(self.fh, r"\pgfsetstrokeopacity{%f}" % alpha)
675675
rgb = tuple(gc.get_rgb())[:3]
676-
if rgb != (0, 0, 0):
677-
writeln(self.fh, r"\definecolor{textcolor}{rgb}{%f,%f,%f}" % rgb)
678-
writeln(self.fh, r"\pgfsetstrokecolor{textcolor}")
679-
writeln(self.fh, r"\pgfsetfillcolor{textcolor}")
680-
s = r"\color{textcolor}" + s
676+
writeln(self.fh, r"\definecolor{textcolor}{rgb}{%f,%f,%f}" % rgb)
677+
writeln(self.fh, r"\pgfsetstrokecolor{textcolor}")
678+
writeln(self.fh, r"\pgfsetfillcolor{textcolor}")
679+
s = r"\color{textcolor}" + s
681680

682681
f = 1.0 / self.figure.dpi
683682
text_args = []

0 commit comments

Comments
 (0)