|
7 | 7 | from matplotlib.transforms import Bbox |
8 | 8 | from .mpl_axes import Axes |
9 | 9 |
|
10 | | -import numpy as np |
11 | | - |
12 | 10 |
|
13 | 11 | class ParasiteAxesBase: |
14 | 12 |
|
@@ -108,72 +106,6 @@ def update_viewlim(self): |
108 | 106 | else: |
109 | 107 | _api.check_in_list([None, "equal", "transform"], mode=mode) |
110 | 108 |
|
111 | | - def _pcolor(self, super_pcolor, *XYC, **kwargs): |
112 | | - if len(XYC) == 1: |
113 | | - C = XYC[0] |
114 | | - ny, nx = C.shape |
115 | | - |
116 | | - gx = np.arange(-0.5, nx) |
117 | | - gy = np.arange(-0.5, ny) |
118 | | - |
119 | | - X, Y = np.meshgrid(gx, gy) |
120 | | - else: |
121 | | - X, Y, C = XYC |
122 | | - |
123 | | - if "transform" in kwargs: |
124 | | - mesh = super_pcolor(X, Y, C, **kwargs) |
125 | | - else: |
126 | | - orig_shape = X.shape |
127 | | - xyt = np.column_stack([X.flat, Y.flat]) |
128 | | - wxy = self.transAux.transform(xyt) |
129 | | - gx = wxy[:, 0].reshape(orig_shape) |
130 | | - gy = wxy[:, 1].reshape(orig_shape) |
131 | | - mesh = super_pcolor(gx, gy, C, **kwargs) |
132 | | - mesh.set_transform(self._parent_axes.transData) |
133 | | - |
134 | | - return mesh |
135 | | - |
136 | | - def pcolormesh(self, *XYC, **kwargs): |
137 | | - return self._pcolor(super().pcolormesh, *XYC, **kwargs) |
138 | | - |
139 | | - def pcolor(self, *XYC, **kwargs): |
140 | | - return self._pcolor(super().pcolor, *XYC, **kwargs) |
141 | | - |
142 | | - def _contour(self, super_contour, *XYCL, **kwargs): |
143 | | - |
144 | | - if len(XYCL) <= 2: |
145 | | - C = XYCL[0] |
146 | | - ny, nx = C.shape |
147 | | - |
148 | | - gx = np.arange(0., nx) |
149 | | - gy = np.arange(0., ny) |
150 | | - |
151 | | - X, Y = np.meshgrid(gx, gy) |
152 | | - CL = XYCL |
153 | | - else: |
154 | | - X, Y = XYCL[:2] |
155 | | - CL = XYCL[2:] |
156 | | - |
157 | | - if "transform" in kwargs: |
158 | | - cont = super_contour(X, Y, *CL, **kwargs) |
159 | | - else: |
160 | | - orig_shape = X.shape |
161 | | - xyt = np.column_stack([X.flat, Y.flat]) |
162 | | - wxy = self.transAux.transform(xyt) |
163 | | - gx = wxy[:, 0].reshape(orig_shape) |
164 | | - gy = wxy[:, 1].reshape(orig_shape) |
165 | | - cont = super_contour(gx, gy, *CL, **kwargs) |
166 | | - for c in cont.collections: |
167 | | - c.set_transform(self._parent_axes.transData) |
168 | | - |
169 | | - return cont |
170 | | - |
171 | | - def contour(self, *XYCL, **kwargs): |
172 | | - return self._contour(super().contour, *XYCL, **kwargs) |
173 | | - |
174 | | - def contourf(self, *XYCL, **kwargs): |
175 | | - return self._contour(super().contourf, *XYCL, **kwargs) |
176 | | - |
177 | 109 | def apply_aspect(self, position=None): |
178 | 110 | self.update_viewlim() |
179 | 111 | super().apply_aspect() |
|
0 commit comments