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

Skip to content

Commit e670dd0

Browse files
committed
Avoiding to use rf and multiline
1 parent 20a73f0 commit e670dd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,11 @@ def print_pdf(self, fname_or_fh, *, metadata=None, **kwargs):
828828
# print figure to pgf and compile it with latex
829829
with TemporaryDirectory() as tmpdir:
830830
tmppath = pathlib.Path(tmpdir)
831+
docclass = mpl.rcParams.get("pgf.documentclass", "article")
831832
self.print_pgf(tmppath / "figure.pgf", **kwargs)
832833
(tmppath / "figure.tex").write_text(
833834
"\n".join([
834-
rf"\documentclass{{{mpl.rcParams.get(
835-
'pgf.documentclass', 'article')}}}",
835+
r"\\documentclass{{{docclass}}}"
836836
r"\usepackage[pdfinfo={%s}]{hyperref}" % pdfinfo,
837837
r"\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}"
838838
% (w, h),

0 commit comments

Comments
 (0)