@@ -163,29 +163,20 @@ def test_rcupdate():
163
163
@pytest .mark .style ('default' )
164
164
@pytest .mark .backend ('pgf' )
165
165
def test_pathclip ():
166
- rc_xelatex = {'font.family' : 'serif' ,
167
- 'pgf.rcfonts' : False }
168
- mpl .rcParams .update (rc_xelatex )
169
-
170
- plt .figure ()
166
+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
171
167
plt .plot ([0. , 1e100 ], [0. , 1e100 ])
172
168
plt .xlim (0 , 1 )
173
169
plt .ylim (0 , 1 )
174
- # this test passes if compiling/saving to pdf works (no image comparison)
175
- plt .savefig (os .path .join (result_dir , "pgf_pathclip.pdf" ))
170
+ plt .savefig (BytesIO (), format = "pdf" ) # No image comparison.
176
171
177
172
178
173
# test mixed mode rendering
179
174
@needs_xelatex
180
175
@pytest .mark .backend ('pgf' )
181
176
@image_comparison (['pgf_mixedmode.pdf' ], style = 'default' )
182
177
def test_mixedmode ():
183
- rc_xelatex = {'font.family' : 'serif' ,
184
- 'pgf.rcfonts' : False }
185
- mpl .rcParams .update (rc_xelatex )
186
-
178
+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
187
179
Y , X = np .ogrid [- 1 :1 :40j , - 1 :1 :40j ]
188
- plt .figure ()
189
180
plt .pcolor (X ** 2 + Y ** 2 ).set_rasterized (True )
190
181
191
182
@@ -194,15 +185,11 @@ def test_mixedmode():
194
185
@pytest .mark .style ('default' )
195
186
@pytest .mark .backend ('pgf' )
196
187
def test_bbox_inches ():
197
- rc_xelatex = {'font.family' : 'serif' ,
198
- 'pgf.rcfonts' : False }
199
- mpl .rcParams .update (rc_xelatex )
200
-
188
+ mpl .rcParams .update ({'font.family' : 'serif' , 'pgf.rcfonts' : False })
201
189
fig , (ax1 , ax2 ) = plt .subplots (1 , 2 )
202
190
ax1 .plot (range (5 ))
203
191
ax2 .plot (range (5 ))
204
192
plt .tight_layout ()
205
-
206
193
bbox = ax1 .get_window_extent ().transformed (fig .dpi_scale_trans .inverted ())
207
194
compare_figure ('pgf_bbox_inches.pdf' , savefig_kwargs = {'bbox_inches' : bbox },
208
195
tol = 0 )
0 commit comments