|
23 | 23 |
|
24 | 24 | import numpy as np |
25 | 25 | import matplotlib as mpl |
26 | | -import matplotlib.cbook as cbook |
27 | | -import matplotlib.colors as mcolors |
28 | | -import matplotlib.cm as cm |
29 | | -from matplotlib import docstring |
30 | | -import matplotlib.transforms as transforms |
31 | | -import matplotlib.artist as artist |
32 | | -from matplotlib.artist import allow_rasterization |
33 | | -import matplotlib.path as mpath |
34 | | -from matplotlib import _path |
35 | | -import matplotlib.mlab as mlab |
36 | | -import matplotlib.lines as mlines |
| 26 | +from . import (_path, artist, cbook, cm, colors as mcolors, docstring, |
| 27 | + lines as mlines, mlab, path as mpath, transforms) |
37 | 28 |
|
38 | 29 | CIRCLE_AREA_FACTOR = 1.0 / np.sqrt(np.pi) |
39 | 30 |
|
@@ -264,7 +255,7 @@ def _prepare_points(self): |
264 | 255 |
|
265 | 256 | return transform, transOffset, offsets, paths |
266 | 257 |
|
267 | | - @allow_rasterization |
| 258 | + @artist.allow_rasterization |
268 | 259 | def draw(self, renderer): |
269 | 260 | if not self.get_visible(): |
270 | 261 | return |
@@ -917,7 +908,7 @@ def set_sizes(self, sizes, dpi=72.0): |
917 | 908 | self._transforms[:, 2, 2] = 1.0 |
918 | 909 | self.stale = True |
919 | 910 |
|
920 | | - @allow_rasterization |
| 911 | + @artist.allow_rasterization |
921 | 912 | def draw(self, renderer): |
922 | 913 | self.set_sizes(self._sizes, self.figure.dpi) |
923 | 914 | Collection.draw(self, renderer) |
@@ -1118,7 +1109,7 @@ def get_numsides(self): |
1118 | 1109 | def get_rotation(self): |
1119 | 1110 | return self._rotation |
1120 | 1111 |
|
1121 | | - @allow_rasterization |
| 1112 | + @artist.allow_rasterization |
1122 | 1113 | def draw(self, renderer): |
1123 | 1114 | self.set_sizes(self._sizes, self.figure.dpi) |
1124 | 1115 | self._transforms = [ |
@@ -1691,7 +1682,7 @@ def _set_transforms(self): |
1691 | 1682 | m[:2, 2:] = 0 |
1692 | 1683 | self.set_transform(_affine(m)) |
1693 | 1684 |
|
1694 | | - @allow_rasterization |
| 1685 | + @artist.allow_rasterization |
1695 | 1686 | def draw(self, renderer): |
1696 | 1687 | self._set_transforms() |
1697 | 1688 | Collection.draw(self, renderer) |
@@ -1797,7 +1788,7 @@ def convert_mesh_to_paths(tri): |
1797 | 1788 | tri.y[triangles][..., np.newaxis]), axis=2) |
1798 | 1789 | return [Path(x) for x in verts] |
1799 | 1790 |
|
1800 | | - @allow_rasterization |
| 1791 | + @artist.allow_rasterization |
1801 | 1792 | def draw(self, renderer): |
1802 | 1793 | if not self.get_visible(): |
1803 | 1794 | return |
@@ -1949,7 +1940,7 @@ def convert_mesh_to_triangles(self, meshWidth, meshHeight, coordinates): |
1949 | 1940 |
|
1950 | 1941 | return triangles, colors |
1951 | 1942 |
|
1952 | | - @allow_rasterization |
| 1943 | + @artist.allow_rasterization |
1953 | 1944 | def draw(self, renderer): |
1954 | 1945 | if not self.get_visible(): |
1955 | 1946 | return |
|
0 commit comments