1212
1313"""
1414from __future__ import print_function
15+ import warnings
16+ from operator import itemgetter
17+
1518import numpy as np
1619
17- import artist
18- from artist import Artist , allow_rasterization
19- from axes import Axes , SubplotBase , subplot_class_factory
20- from cbook import allequal , Stack , iterable
21- from matplotlib import _image
22- import colorbar as cbar
23- from image import FigureImage
24- from matplotlib import rcParams
25- from patches import Rectangle
26- from text import Text , _process_text_args
27-
28- from legend import Legend
29- from transforms import Affine2D , Bbox , BboxTransformTo , TransformedBbox
30- from projections import get_projection_names , process_projection_requirements
31- from matplotlib .blocking_input import BlockingMouseInput , BlockingKeyMouseInput
20+ from matplotlib import rcParams , docstring
21+
22+ import matplotlib .artist as martist
23+ from matplotlib .artist import Artist , allow_rasterization
3224
3325import matplotlib .cbook as cbook
34- from matplotlib import docstring
26+ from matplotlib . cbook import Stack , iterable
3527
36- from operator import itemgetter
28+ from matplotlib import _image
29+ from matplotlib .image import FigureImage
30+
31+ import matplotlib .colorbar as cbar
32+
33+ from matplotlib .axes import Axes , SubplotBase , subplot_class_factory
34+ from matplotlib .blocking_input import BlockingMouseInput , BlockingKeyMouseInput
35+ from matplotlib .legend import Legend
36+ from matplotlib .patches import Rectangle
37+ from matplotlib .projections import (get_projection_names ,
38+ process_projection_requirements )
39+ from matplotlib .text import Text , _process_text_args
40+ from matplotlib .transforms import (Affine2D , Bbox , BboxTransformTo ,
41+ TransformedBbox )
3742
3843
3944docstring .interpd .update (projection_names = get_projection_names ())
@@ -918,7 +923,7 @@ def draw(self, renderer):
918923 not_composite = self .suppressComposite
919924
920925 if len (self .images )<= 1 or not_composite or \
921- not allequal ([im .origin for im in self .images ]):
926+ not cbook . allequal ([im .origin for im in self .images ]):
922927 for a in self .images :
923928 dsu .append ( (a .get_zorder (), a , a .draw , [renderer ]))
924929 else :
@@ -1113,7 +1118,7 @@ def gca(self, **kwargs):
11131118 The following kwargs are supported for ensuring the returned axes
11141119 adheres to the given projection etc., and for axes creation if
11151120 the active axes does not exist:
1116-
1121+
11171122 %(Axes)s
11181123
11191124 """
@@ -1135,7 +1140,7 @@ def gca(self, **kwargs):
11351140 kwargs_copy = kwargs .copy ()
11361141 projection_class , _ , key = \
11371142 process_projection_requirements (self , ** kwargs_copy )
1138-
1143+
11391144 # let the returned axes have any gridspec by removing it from the key
11401145 ckey = ckey [1 :]
11411146 key = key [1 :]
@@ -1144,7 +1149,7 @@ def gca(self, **kwargs):
11441149 # continue and a new axes will be created
11451150 if key == ckey and isinstance (cax , projection_class ):
11461151 return cax
1147-
1152+
11481153 # no axes found, so create one which spans the figure
11491154 return self .add_subplot (1 , 1 , 1 , ** kwargs )
11501155
@@ -1497,4 +1502,4 @@ def figaspect(arg):
14971502 newsize = np .clip (newsize ,figsize_min ,figsize_max )
14981503 return newsize
14991504
1500- docstring .interpd .update (Figure = artist .kwdoc (Figure ))
1505+ docstring .interpd .update (Figure = martist .kwdoc (Figure ))
0 commit comments