@@ -192,26 +192,29 @@ def set_top_view(self):
192192 def _init_axis (self ):
193193 '''Init 3D axes; overrides creation of regular X/Y axes'''
194194 self .w_xaxis = axis3d .XAxis ('x' , self .xy_viewLim .intervalx ,
195- self .xy_dataLim .intervalx , self )
195+ self .xy_dataLim .intervalx , self )
196196 self .xaxis = self .w_xaxis
197197 self .w_yaxis = axis3d .YAxis ('y' , self .xy_viewLim .intervaly ,
198- self .xy_dataLim .intervaly , self )
198+ self .xy_dataLim .intervaly , self )
199199 self .yaxis = self .w_yaxis
200200 self .w_zaxis = axis3d .ZAxis ('z' , self .zz_viewLim .intervalx ,
201- self .zz_dataLim .intervalx , self )
201+ self .zz_dataLim .intervalx , self )
202202 self .zaxis = self .w_zaxis
203203
204204 for ax in self .xaxis , self .yaxis , self .zaxis :
205205 ax .init3d ()
206206
207207 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 , )
209212
210213 def unit_cube (self , vals = None ):
211214 minx , maxx , miny , maxy , minz , maxz = vals or self .get_w_lims ()
212215 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 ])
215218 return list (zip (xs , ys , zs ))
216219
217220 def tunit_cube (self , vals = None , M = None ):
@@ -244,6 +247,18 @@ def draw(self, renderer):
244247 self .axesPatch .draw (renderer )
245248 self ._frameon = False
246249
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+
247262 # add the projection matrix to the renderer
248263 self .M = self .get_proj ()
249264 renderer .M = self .M
@@ -1718,7 +1733,7 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
17181733
17191734 The `rstride` and `cstride` kwargs set the stride used to
17201735 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
17221737 3D line plot rather than a wireframe plot.
17231738
17241739 ========== ================================================
@@ -2438,7 +2453,7 @@ def bar3d(self, x, y, z, dx, dy, dz, color='b',
24382453 self .add_collection (col )
24392454
24402455 self .auto_scale_xyz ((minx , maxx ), (miny , maxy ), (minz , maxz ), had_data )
2441-
2456+
24422457 return col
24432458
24442459 def set_title (self , label , fontdict = None , loc = 'center' , ** kwargs ):
0 commit comments