@@ -531,7 +531,8 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
531
531
Rectangle artist.
532
532
533
533
connector_lines : list of `.Patches.ConnectionPatch`
534
- One for each of four connector lines.
534
+ One for each of four connector lines
535
+ (empty if *inset_ax* is *None*).
535
536
Two are set with visibility to *False*,
536
537
but the user can set the visibility to *True* if the
537
538
automatic choice is not deemed correct.
@@ -552,19 +553,24 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
552
553
zorder = zorder , label = label , transform = transform , ** kwargs )
553
554
self .add_patch (rectpatch )
554
555
556
+ connects = []
557
+
555
558
if inset_ax is not None :
556
559
# want to connect the indicator to the rect....
557
- connects = []
558
560
xr = [bounds [0 ], bounds [0 ]+ bounds [2 ]]
559
561
yr = [bounds [1 ], bounds [1 ]+ bounds [3 ]]
560
562
for xc in range (2 ):
561
563
for yc in range (2 ):
562
564
xyA = (xc , yc )
563
565
xyB = (xr [xc ], yr [yc ])
564
- connects += [mpatches .ConnectionPatch (xyA , xyB ,
566
+ connects .append (
567
+ mpatches .ConnectionPatch (
568
+ xyA , xyB ,
565
569
'axes fraction' , 'data' ,
566
570
axesA = inset_ax , axesB = self , arrowstyle = "-" ,
567
- zorder = zorder , edgecolor = edgecolor , alpha = alpha )]
571
+ zorder = zorder , edgecolor = edgecolor , alpha = alpha
572
+ )
573
+ )
568
574
self .add_patch (connects [- 1 ])
569
575
# decide which two of the lines to keep visible....
570
576
pos = inset_ax .get_position ()
0 commit comments