@@ -192,26 +192,29 @@ def set_top_view(self):
192
192
def _init_axis (self ):
193
193
'''Init 3D axes; overrides creation of regular X/Y axes'''
194
194
self .w_xaxis = axis3d .XAxis ('x' , self .xy_viewLim .intervalx ,
195
- self .xy_dataLim .intervalx , self )
195
+ self .xy_dataLim .intervalx , self )
196
196
self .xaxis = self .w_xaxis
197
197
self .w_yaxis = axis3d .YAxis ('y' , self .xy_viewLim .intervaly ,
198
- self .xy_dataLim .intervaly , self )
198
+ self .xy_dataLim .intervaly , self )
199
199
self .yaxis = self .w_yaxis
200
200
self .w_zaxis = axis3d .ZAxis ('z' , self .zz_viewLim .intervalx ,
201
- self .zz_dataLim .intervalx , self )
201
+ self .zz_dataLim .intervalx , self )
202
202
self .zaxis = self .w_zaxis
203
203
204
204
for ax in self .xaxis , self .yaxis , self .zaxis :
205
205
ax .init3d ()
206
206
207
207
def get_children (self ):
208
- return [self .zaxis ,] + Axes .get_children (self )
208
+ return [self .zaxis , ] + Axes .get_children (self )
209
+
210
+ def _get_axis_list (self ):
211
+ return super (Axes3D , self )._get_axis_list () + (self .zaxis , )
209
212
210
213
def unit_cube (self , vals = None ):
211
214
minx , maxx , miny , maxy , minz , maxz = vals or self .get_w_lims ()
212
215
xs , ys , zs = ([minx , maxx , maxx , minx , minx , maxx , maxx , minx ],
213
- [miny , miny , maxy , maxy , miny , miny , maxy , maxy ],
214
- [minz , minz , minz , minz , maxz , maxz , maxz , maxz ])
216
+ [miny , miny , maxy , maxy , miny , miny , maxy , maxy ],
217
+ [minz , minz , minz , minz , maxz , maxz , maxz , maxz ])
215
218
return list (zip (xs , ys , zs ))
216
219
217
220
def tunit_cube (self , vals = None , M = None ):
@@ -244,6 +247,18 @@ def draw(self, renderer):
244
247
self .axesPatch .draw (renderer )
245
248
self ._frameon = False
246
249
250
+ # first, set the aspect
251
+ # this is duplicated from `axes._base._AxesBase.draw`
252
+ # but must be called before any of the artist are drawn as
253
+ # it adjusts the view limits and the size of the bounding box
254
+ # of the axes
255
+ locator = self .get_axes_locator ()
256
+ if locator :
257
+ pos = locator (self , renderer )
258
+ self .apply_aspect (pos )
259
+ else :
260
+ self .apply_aspect ()
261
+
247
262
# add the projection matrix to the renderer
248
263
self .M = self .get_proj ()
249
264
renderer .M = self .M
@@ -1718,7 +1733,7 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
1718
1733
1719
1734
The `rstride` and `cstride` kwargs set the stride used to
1720
1735
sample the input data to generate the graph. If either is 0
1721
- the input data in not sampled along this direction producing a
1736
+ the input data in not sampled along this direction producing a
1722
1737
3D line plot rather than a wireframe plot.
1723
1738
1724
1739
========== ================================================
@@ -2438,7 +2453,7 @@ def bar3d(self, x, y, z, dx, dy, dz, color='b',
2438
2453
self .add_collection (col )
2439
2454
2440
2455
self .auto_scale_xyz ((minx , maxx ), (miny , maxy ), (minz , maxz ), had_data )
2441
-
2456
+
2442
2457
return col
2443
2458
2444
2459
def set_title (self , label , fontdict = None , loc = 'center' , ** kwargs ):
0 commit comments