5
5
6
6
import matplotlib .cbook as cbook
7
7
8
- import matplotlib .pyplot as plt
9
8
import matplotlib .axes as maxes
10
9
#import matplotlib.colorbar as mcolorbar
11
10
from . import colorbar as mcolorbar
@@ -807,94 +806,3 @@ def _update_locators(self):
807
806
808
807
AxesGrid = ImageGrid
809
808
810
- #if __name__ == "__main__":
811
- if 0 :
812
- F = plt .figure (1 , (7 , 6 ))
813
- F .clf ()
814
-
815
- F .subplots_adjust (left = 0.15 , right = 0.9 )
816
-
817
- grid = Grid (F , 111 , # similar to subplot(111)
818
- nrows_ncols = (2 , 2 ),
819
- direction = "row" ,
820
- axes_pad = 0.05 ,
821
- add_all = True ,
822
- label_mode = "1" ,
823
- )
824
-
825
- #if __name__ == "__main__":
826
- if 0 :
827
- from .axes_divider import get_demo_image
828
- F = plt .figure (1 , (9 , 3.5 ))
829
- F .clf ()
830
-
831
- F .subplots_adjust (left = 0.05 , right = 0.98 )
832
-
833
- grid = ImageGrid (F , 131 , # similar to subplot(111)
834
- nrows_ncols = (2 , 2 ),
835
- direction = "row" ,
836
- axes_pad = 0.05 ,
837
- add_all = True ,
838
- label_mode = "1" ,
839
- )
840
-
841
- Z , extent = get_demo_image ()
842
- plt .ioff ()
843
- for i in range (4 ):
844
- im = grid [i ].imshow (Z , extent = extent , interpolation = "nearest" )
845
-
846
- # This only affects axes in
847
- # first column and second row as share_all = False.
848
- grid .axes_llc .set_xticks ([- 2 , 0 , 2 ])
849
- grid .axes_llc .set_yticks ([- 2 , 0 , 2 ])
850
- plt .ion ()
851
-
852
- grid = ImageGrid (F , 132 , # similar to subplot(111)
853
- nrows_ncols = (2 , 2 ),
854
- direction = "row" ,
855
- axes_pad = 0.0 ,
856
- add_all = True ,
857
- share_all = True ,
858
- label_mode = "1" ,
859
- cbar_mode = "single" ,
860
- )
861
-
862
- Z , extent = get_demo_image ()
863
- plt .ioff ()
864
- for i in range (4 ):
865
- im = grid [i ].imshow (Z , extent = extent , interpolation = "nearest" )
866
- plt .colorbar (im , cax = grid .cbar_axes [0 ])
867
- plt .setp (grid .cbar_axes [0 ].get_yticklabels (), visible = False )
868
-
869
- # This affects all axes as share_all = True.
870
- grid .axes_llc .set_xticks ([- 2 , 0 , 2 ])
871
- grid .axes_llc .set_yticks ([- 2 , 0 , 2 ])
872
-
873
- plt .ion ()
874
-
875
- grid = ImageGrid (F , 133 , # similar to subplot(122)
876
- nrows_ncols = (2 , 2 ),
877
- direction = "row" ,
878
- axes_pad = 0.1 ,
879
- add_all = True ,
880
- label_mode = "1" ,
881
- share_all = True ,
882
- cbar_location = "top" ,
883
- cbar_mode = "each" ,
884
- cbar_size = "7%" ,
885
- cbar_pad = "2%" ,
886
- )
887
- plt .ioff ()
888
- for i in range (4 ):
889
- im = grid [i ].imshow (Z , extent = extent , interpolation = "nearest" )
890
- plt .colorbar (im , cax = grid .cbar_axes [i ],
891
- orientation = "horizontal" )
892
- grid .cbar_axes [i ].xaxis .set_ticks_position ("top" )
893
- plt .setp (grid .cbar_axes [i ].get_xticklabels (), visible = False )
894
-
895
- # This affects all axes as share_all = True.
896
- grid .axes_llc .set_xticks ([- 2 , 0 , 2 ])
897
- grid .axes_llc .set_yticks ([- 2 , 0 , 2 ])
898
-
899
- plt .ion ()
900
- plt .draw ()
0 commit comments