@@ -235,19 +235,14 @@ def test_inset_axes_without_transform_should_use_parent_axes():
235
235
def test_fill_facecolor ():
236
236
fig , ax = plt .subplots (1 , 5 )
237
237
fig .set_size_inches (5 , 5 )
238
- trans1 = blended_transform_factory (ax [0 ].transData , ax [0 ].transData )
239
- trans2 = blended_transform_factory (ax [1 ].transData , ax [1 ].transData )
240
- trans3 = blended_transform_factory (ax [2 ].transData , ax [2 ].transData )
241
- trans4 = blended_transform_factory (ax [3 ].transData , ax [3 ].transData )
242
- trans5 = blended_transform_factory (ax [4 ].transData , ax [4 ].transData )
243
238
for i in range (1 , 4 ):
244
239
ax [i ].yaxis .set_visible (False )
245
240
ax [4 ].yaxis .tick_right ()
246
241
bbox = Bbox .from_extents (0 , 0.4 , 1 , 0.6 )
247
242
248
243
# fill with blue by setting 'fc' field
249
- bbox1 = TransformedBbox (bbox , trans1 )
250
- bbox2 = TransformedBbox (bbox , trans2 )
244
+ bbox1 = TransformedBbox (bbox , ax [ 0 ]. transData )
245
+ bbox2 = TransformedBbox (bbox , ax [ 1 ]. transData )
251
246
# set color to BboxConnectorPatch
252
247
p = BboxConnectorPatch (
253
248
bbox1 , bbox2 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -263,8 +258,8 @@ def test_fill_facecolor():
263
258
mark_inset (ax [0 ], axins , loc1 = 2 , loc2 = 4 , fc = "b" , ec = "0.5" )
264
259
265
260
# fill with yellow by setting 'facecolor' field
266
- bbox3 = TransformedBbox (bbox , trans2 )
267
- bbox4 = TransformedBbox (bbox , trans3 )
261
+ bbox3 = TransformedBbox (bbox , ax [ 1 ]. transData )
262
+ bbox4 = TransformedBbox (bbox , ax [ 2 ]. transData )
268
263
# set color to BboxConnectorPatch
269
264
p = BboxConnectorPatch (
270
265
bbox3 , bbox4 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -280,8 +275,8 @@ def test_fill_facecolor():
280
275
mark_inset (ax [1 ], axins , loc1 = 2 , loc2 = 4 , facecolor = "y" , ec = "0.5" )
281
276
282
277
# fill with green by setting 'color' field
283
- bbox5 = TransformedBbox (bbox , trans3 )
284
- bbox6 = TransformedBbox (bbox , trans4 )
278
+ bbox5 = TransformedBbox (bbox , ax [ 2 ]. transData )
279
+ bbox6 = TransformedBbox (bbox , ax [ 3 ]. transData )
285
280
# set color to BboxConnectorPatch
286
281
p = BboxConnectorPatch (
287
282
bbox5 , bbox6 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -297,8 +292,8 @@ def test_fill_facecolor():
297
292
mark_inset (ax [2 ], axins , loc1 = 2 , loc2 = 4 , color = "g" , ec = "0.5" )
298
293
299
294
# fill with green but color won't show if set fill to False
300
- bbox7 = TransformedBbox (bbox , trans4 )
301
- bbox8 = TransformedBbox (bbox , trans5 )
295
+ bbox7 = TransformedBbox (bbox , ax [ 3 ]. transData )
296
+ bbox8 = TransformedBbox (bbox , ax [ 4 ]. transData )
302
297
# BboxConnectorPatch won't show green
303
298
p = BboxConnectorPatch (
304
299
bbox7 , bbox8 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -309,8 +304,8 @@ def test_fill_facecolor():
309
304
axins = zoomed_inset_axes (ax [3 ], 1 , loc = 1 )
310
305
axins .set_xlim (0 , 0.2 )
311
306
axins .set_ylim (0 , 0.2 )
312
- plt . gca (). axes .get_xaxis ().set_ticks ([])
313
- plt . gca (). axes .get_yaxis ().set_ticks ([])
307
+ axins .get_xaxis ().set_ticks ([])
308
+ axins .get_yaxis ().set_ticks ([])
314
309
mark_inset (ax [3 ], axins , loc1 = 2 , loc2 = 4 , fc = "g" , ec = "0.5" , fill = False )
315
310
316
311
0 commit comments