@@ -707,3 +707,30 @@ def test_removal():
707
707
fig .canvas .draw ()
708
708
col .remove ()
709
709
fig .canvas .draw ()
710
+
711
+
712
+ @image_comparison (['anchored_locator_base_call.png' ],style = 'classic' )
713
+ def test_anchored_locator_base_call ():
714
+ fig = plt .figure (figsize = (3 ,3 ))
715
+ fig1 , fig2 = fig .subfigures (nrows = 2 , ncols = 1 , height_ratios = [1 , 1 ], squeeze = True )
716
+
717
+ ax = fig1 .subplots ()
718
+ ax .set (aspect = 1 , xlim = (- 15 , 15 ), ylim = (- 20 , 5 ))
719
+
720
+ Z = cbook .get_sample_data ("axes_grid/bivariate_normal.npy" , np_load = True )
721
+ extent = (- 3 , 4 , - 4 , 3 )
722
+
723
+ axins = zoomed_inset_axes (ax , zoom = 2 , loc = 'upper left' )
724
+ axins .set (xticks = [], yticks = [])
725
+ im = axins .imshow (Z , extent = extent , origin = "lower" )
726
+
727
+ # colorbar
728
+ cax = inset_axes (axins ,
729
+ width = "5%" , # width = 10% of parent_bbox width
730
+ height = "100%" , # height : 50%
731
+ loc = 'lower left' ,
732
+ bbox_to_anchor = (1.05 , 0. , 1 , 1 ),
733
+ bbox_transform = axins .transAxes ,
734
+ borderpad = 0 ,
735
+ )
736
+ fig .colorbar (im , cax = cax )
0 commit comments