|
12 | 12 |
|
13 | 13 | """ |
14 | 14 | from __future__ import print_function |
| 15 | +import warnings |
| 16 | +from operator import itemgetter |
| 17 | + |
15 | 18 | import numpy as np |
16 | 19 |
|
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 |
32 | 24 |
|
33 | 25 | import matplotlib.cbook as cbook |
34 | | -from matplotlib import docstring |
| 26 | +from matplotlib.cbook import Stack, iterable |
35 | 27 |
|
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) |
37 | 42 |
|
38 | 43 |
|
39 | 44 | docstring.interpd.update(projection_names = get_projection_names()) |
@@ -918,7 +923,7 @@ def draw(self, renderer): |
918 | 923 | not_composite = self.suppressComposite |
919 | 924 |
|
920 | 925 | 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]): |
922 | 927 | for a in self.images: |
923 | 928 | dsu.append( (a.get_zorder(), a, a.draw, [renderer])) |
924 | 929 | else: |
@@ -1113,7 +1118,7 @@ def gca(self, **kwargs): |
1113 | 1118 | The following kwargs are supported for ensuring the returned axes |
1114 | 1119 | adheres to the given projection etc., and for axes creation if |
1115 | 1120 | the active axes does not exist: |
1116 | | - |
| 1121 | +
|
1117 | 1122 | %(Axes)s |
1118 | 1123 |
|
1119 | 1124 | """ |
@@ -1135,7 +1140,7 @@ def gca(self, **kwargs): |
1135 | 1140 | kwargs_copy = kwargs.copy() |
1136 | 1141 | projection_class, _, key = \ |
1137 | 1142 | process_projection_requirements(self, **kwargs_copy) |
1138 | | - |
| 1143 | + |
1139 | 1144 | # let the returned axes have any gridspec by removing it from the key |
1140 | 1145 | ckey = ckey[1:] |
1141 | 1146 | key = key[1:] |
@@ -1144,7 +1149,7 @@ def gca(self, **kwargs): |
1144 | 1149 | # continue and a new axes will be created |
1145 | 1150 | if key == ckey and isinstance(cax, projection_class): |
1146 | 1151 | return cax |
1147 | | - |
| 1152 | + |
1148 | 1153 | # no axes found, so create one which spans the figure |
1149 | 1154 | return self.add_subplot(1, 1, 1, **kwargs) |
1150 | 1155 |
|
@@ -1497,4 +1502,4 @@ def figaspect(arg): |
1497 | 1502 | newsize = np.clip(newsize,figsize_min,figsize_max) |
1498 | 1503 | return newsize |
1499 | 1504 |
|
1500 | | -docstring.interpd.update(Figure=artist.kwdoc(Figure)) |
| 1505 | +docstring.interpd.update(Figure=martist.kwdoc(Figure)) |