20
20
class InsetPosition (object ):
21
21
def __init__ (self , parent , lbwh ):
22
22
self .parent = parent
23
- self .lbwh = lbwh # position of the inset axes in the normalized coordinate of the parent axes
23
+ self .lbwh = lbwh # position of the inset axes in
24
+ # the normalized coordinate of the parent axes
24
25
25
26
def __call__ (self , ax , renderer ):
26
27
bbox_parent = self .parent .get_position (original = False )
@@ -37,8 +38,8 @@ def __init__(self, bbox_to_anchor, offsetbox, loc,
37
38
super (AnchoredLocatorBase , self ).__init__ (loc ,
38
39
pad = 0. , child = None ,
39
40
borderpad = borderpad ,
40
- bbox_to_anchor = bbox_to_anchor ,
41
- bbox_transform = bbox_transform )
41
+ box_to_anchor = bbox_to_anchor ,
42
+ box_transform = bbox_transform )
42
43
43
44
def draw (self , renderer ):
44
45
raise RuntimeError ("No draw method should be called" )
@@ -115,7 +116,8 @@ def __init__(self, parent_axes, zoom, loc,
115
116
116
117
def get_extent (self , renderer ):
117
118
118
- bb = mtrans .TransformedBbox (self .axes .viewLim , self .parent_axes .transData )
119
+ bb = mtrans .TransformedBbox (self .axes .viewLim ,
120
+ self .parent_axes .transData )
119
121
120
122
x , y , w , h = bb .bounds
121
123
@@ -238,8 +240,11 @@ def __init__(self, bbox1, bbox2, loc1a, loc2a, loc1b, loc2b, **kwargs):
238
240
239
241
def get_path (self ):
240
242
path1 = self .connect_bbox (self .bbox1 , self .bbox2 , self .loc1 , self .loc2 )
241
- path2 = self .connect_bbox (self .bbox2 , self .bbox1 , self .loc2b , self .loc1b )
242
- path_merged = list (path1 .vertices ) + list (path2 .vertices ) + [path1 .vertices [0 ]]
243
+ path2 = self .connect_bbox (self .bbox2 , self .bbox1 ,
244
+ self .loc2b , self .loc1b )
245
+ path_merged = (list (path1 .vertices ) +
246
+ list (path2 .vertices ) +
247
+ [path1 .vertices [0 ]])
243
248
return Path (path_merged )
244
249
245
250
@@ -295,7 +300,8 @@ def zoomed_inset_axes(parent_axes, zoom, loc=1,
295
300
** axes_kwargs )
296
301
297
302
axes_locator = AnchoredZoomLocator (parent_axes , zoom = zoom , loc = loc ,
298
- bbox_to_anchor = bbox_to_anchor , bbox_transform = bbox_transform ,
303
+ bbox_to_anchor = bbox_to_anchor ,
304
+ bbox_transform = bbox_transform ,
299
305
** kwargs )
300
306
inset_axes .set_axes_locator (axes_locator )
301
307
0 commit comments