@@ -235,19 +235,14 @@ def test_inset_axes_without_transform_should_use_parent_axes():
235235def test_fill_facecolor ():
236236 fig , ax = plt .subplots (1 , 5 )
237237 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 )
243238 for i in range (1 , 4 ):
244239 ax [i ].yaxis .set_visible (False )
245240 ax [4 ].yaxis .tick_right ()
246241 bbox = Bbox .from_extents (0 , 0.4 , 1 , 0.6 )
247242
248243 # 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 )
251246 # set color to BboxConnectorPatch
252247 p = BboxConnectorPatch (
253248 bbox1 , bbox2 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -263,8 +258,8 @@ def test_fill_facecolor():
263258 mark_inset (ax [0 ], axins , loc1 = 2 , loc2 = 4 , fc = "b" , ec = "0.5" )
264259
265260 # 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 )
268263 # set color to BboxConnectorPatch
269264 p = BboxConnectorPatch (
270265 bbox3 , bbox4 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -280,8 +275,8 @@ def test_fill_facecolor():
280275 mark_inset (ax [1 ], axins , loc1 = 2 , loc2 = 4 , facecolor = "y" , ec = "0.5" )
281276
282277 # 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 )
285280 # set color to BboxConnectorPatch
286281 p = BboxConnectorPatch (
287282 bbox5 , bbox6 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -297,8 +292,8 @@ def test_fill_facecolor():
297292 mark_inset (ax [2 ], axins , loc1 = 2 , loc2 = 4 , color = "g" , ec = "0.5" )
298293
299294 # 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 )
302297 # BboxConnectorPatch won't show green
303298 p = BboxConnectorPatch (
304299 bbox7 , bbox8 , loc1a = 1 , loc2a = 2 , loc1b = 4 , loc2b = 3 ,
@@ -309,8 +304,8 @@ def test_fill_facecolor():
309304 axins = zoomed_inset_axes (ax [3 ], 1 , loc = 1 )
310305 axins .set_xlim (0 , 0.2 )
311306 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 ([])
314309 mark_inset (ax [3 ], axins , loc1 = 2 , loc2 = 4 , fc = "g" , ec = "0.5" , fill = False )
315310
316311
0 commit comments