Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1652ed1

Browse files
authored
Merge pull request#11192 from anntzer/pgffix2
Don't use deprecated get_texcommand in backend_pgf.
2 parentsf817aff +b3b8841 commit1652ed1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎lib/matplotlib/backends/backend_pgf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
importlogging
55
importmath
66
importos
7-
frompathlibimportPath
7+
importpathlib
88
importre
99
importshutil
1010
importsubprocess
@@ -69,7 +69,7 @@ def get_fontspec():
6969
forfamily,commandinzip(families,commands):
7070
# 1) Forward slashes also work on Windows, so don't mess with
7171
# backslashes. 2) The dirname needs to include a separator.
72-
path=Path(fm.findfont(family))
72+
path=pathlib.Path(fm.findfont(family))
7373
latex_fontspec.append(r"\%s{%s}[Path=%s]"% (
7474
command,path.name,path.parent.as_posix()+"/"))
7575

@@ -1119,9 +1119,9 @@ def close(self):
11191119
open(self._outputfile,'wb').close()
11201120

11211121
def_run_latex(self):
1122-
texcommand=get_texcommand()
1122+
texcommand=rcParams["pgf.texsystem"]
11231123
cmdargs= [
1124-
str(texcommand),
1124+
texcommand,
11251125
"-interaction=nonstopmode",
11261126
"-halt-on-error",
11271127
os.path.basename(self._fname_tex),
@@ -1183,12 +1183,11 @@ def _build_newpage_command(self, width, height):
11831183
so we need to check the lualatex version and use `\pagewidth` if
11841184
the version is 0.85 or newer
11851185
'''
1186-
texcommand=get_texcommand()
1186+
texcommand=rcParams["pgf.texsystem"]
11871187
iftexcommand=='lualatex'and_get_lualatex_version()>= (0,85,0):
11881188
cmd=r'\page'
11891189
else:
11901190
cmd=r'\pdfpage'
1191-
11921191
newpage=r'\newpage{cmd}width={w}in,{cmd}height={h}in%'+'\n'
11931192
returnnewpage.format(cmd=cmd,w=width,h=height).encode('utf-8')
11941193

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp