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

Commite237bbd

Browse files
authored
Merge pull request#26955 from anntzer/pst
Fix incorrect skip check in test_backend_ps.
2 parentse3a5cee +1e69938 commite237bbd

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

‎lib/matplotlib/backends/backend_macosx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __init__(self, canvas, num):
147147
icon_path=str(cbook._get_data_path('images/matplotlib.pdf'))
148148
_macosx.FigureManager.set_icon(icon_path)
149149
FigureManagerBase.__init__(self,canvas,num)
150-
self._set_window_mode(mpl.rcParams.get("macosx.window_mode","system"))
150+
self._set_window_mode(mpl.rcParams["macosx.window_mode"])
151151
ifself.toolbarisnotNone:
152152
self.toolbar.update()
153153
ifmpl.is_interactive():

‎lib/matplotlib/tests/test_backend_ps.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,19 @@
4040
'eps with usetex'
4141
])
4242
deftest_savefig_to_stringio(format,use_log,rcParams,orientation,papersize):
43-
ifrcParams.get("ps.usedistiller")=="ghostscript":
43+
mpl.rcParams.update(rcParams)
44+
ifmpl.rcParams["ps.usedistiller"]=="ghostscript":
4445
try:
4546
mpl._get_executable_info("gs")
4647
exceptmpl.ExecutableNotFoundErrorasexc:
4748
pytest.skip(str(exc))
48-
elifrcParams.get("ps.userdistiller")=="xpdf":
49+
elifmpl.rcParams["ps.usedistiller"]=="xpdf":
4950
try:
5051
mpl._get_executable_info("gs")# Effectively checks for ps2pdf.
5152
mpl._get_executable_info("pdftops")
5253
exceptmpl.ExecutableNotFoundErrorasexc:
5354
pytest.skip(str(exc))
5455

55-
mpl.rcParams.update(rcParams)
56-
5756
fig,ax=plt.subplots()
5857

5958
withio.StringIO()ass_buf,io.BytesIO()asb_buf:
@@ -67,9 +66,9 @@ def test_savefig_to_stringio(format, use_log, rcParams, orientation, papersize):
6766
title+="\N{MINUS SIGN}\N{EURO SIGN}"
6867
ax.set_title(title)
6968
allowable_exceptions= []
70-
ifrcParams.get("text.usetex"):
69+
ifmpl.rcParams["text.usetex"]:
7170
allowable_exceptions.append(RuntimeError)
72-
ifrcParams.get("ps.useafm"):
71+
ifmpl.rcParams["ps.useafm"]:
7372
allowable_exceptions.append(mpl.MatplotlibDeprecationWarning)
7473
try:
7574
fig.savefig(s_buf,format=format,orientation=orientation,
@@ -87,14 +86,14 @@ def test_savefig_to_stringio(format, use_log, rcParams, orientation, papersize):
8786
ifformat=='ps':
8887
# Default figsize = (8, 6) inches = (576, 432) points = (203.2, 152.4) mm.
8988
# Landscape orientation will swap dimensions.
90-
ifrcParams.get("ps.usedistiller")=="xpdf":
89+
ifmpl.rcParams["ps.usedistiller"]=="xpdf":
9190
# Some versions specifically show letter/203x152, but not all,
9291
# so we can only use this simpler test.
9392
ifpapersize=='figure':
9493
assertb'letter'notins_val.lower()
9594
else:
9695
assertb'letter'ins_val.lower()
97-
elifrcParams.get("ps.usedistiller")orrcParams.get("text.usetex"):
96+
elifmpl.rcParams["ps.usedistiller"]ormpl.rcParams["text.usetex"]:
9897
width=b'432.0'iforientation=='landscape'elseb'576.0'
9998
wanted= (b'-dDEVICEWIDTHPOINTS='+widthifpapersize=='figure'
10099
elseb'-sPAPERSIZE')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp