1919import cbook
2020from transforms import unit_bbox
2121
22+ import figure
2223import numerix as nx
2324from colors import normalize
2425
@@ -56,8 +57,8 @@ class Axes3DI(Axes):
5657 """
5758 def __init__ (self , fig = None , rect = [0.0 , 0.0 , 1.0 , 1.0 ], * args , ** kwargs ):
5859 #
59- fig = fig or pylab . gcf ()
60-
60+ self . fig = fig or figure . Figure ()
61+
6162 azim = cbook .popd (kwargs , 'azim' , - 60 )
6263 elev = cbook .popd (kwargs , 'elev' , 30 )
6364
@@ -70,12 +71,12 @@ def __init__(self, fig=None, rect=[0.0, 0.0, 1.0, 1.0], *args, **kwargs):
7071 # inihibit autoscale_view until the axises are defined
7172 # they can't be defined until Axes.__init__ has been called
7273 self ._ready = 0
73- Axes .__init__ (self , fig , rect ,
74+ Axes .__init__ (self , self . fig , rect ,
7475 frameon = True ,
7576 xticks = [], yticks = [], * args , ** kwargs )
7677 #
77- figmanager = pylab .get_current_fig_manager ()
78- self .toolbar = figmanager .toolbar
78+ # figmanager = pylab.get_current_fig_manager()
79+ # self.toolbar = figmanager.toolbar
7980 #
8081 #
8182 # self.toolbar._active is current zoom/pan mode
@@ -85,14 +86,14 @@ def __init__(self, fig=None, rect=[0.0, 0.0, 1.0, 1.0], *args, **kwargs):
8586 self ._ready = 1
8687
8788 self .view_init (elev , azim )
88- self .mouse_init ()
89+ # self.mouse_init()
8990 self .create_axes ()
9091 self .set_top_view ()
9192
9293 #self.axesPatch.set_edgecolor((1,0,0,0))
9394 self .axesPatch .set_linewidth (0 )
9495 #self.axesPatch.set_facecolor((0,0,0,0))
95- fig .add_axes (self )
96+ self . fig .add_axes (self )
9697
9798
9899 def set_top_view (self ):
@@ -148,7 +149,8 @@ def unit_cube(self,vals=None):
148149 return zip (xs ,ys ,zs )
149150
150151 def tunit_cube (self ,vals = None ,M = None ):
151- M = M or self .M
152+ if M is None :
153+ M = self .M
152154 xyzs = self .unit_cube (vals )
153155 tcube = proj3d .proj_points (xyzs ,M )
154156 return tcube
0 commit comments