[Matplotlib-users] mixed_subplots_demo.py

2011-02-22 Thread Patton Bradford
Trying to get the referenced example from the mplot3d example web page working 
with Python 2.6.1 on Windows XP.  Naturally, the line:
 
ax = fig.add_subplot(2, 1, 2, projection='3d')
 
fails since '3d' is not a recognized projection.  Now, if I want to just plot 
the 3d, the solution that works seems to be:
fig = plt.figure()
ax = Axes3D(fig)
snip
surf = ax.plot_surface(snip)
 
However, I can't seem to find a way to create the one figure, add the 2D 
subplot and then the 3D subplot.
 
Any suggestions?
 
Thanks in advance.

 --
Free Software Download: Index, Search  Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev ___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot_wireframe

2011-02-02 Thread Patton Bradford
Just trying to get familiar with mplot3d's functions, and I've run into a 
problem with plot_wireframe that I'm having problems running down (or 
duplicating, for that matter).  I'm trying to generate plots of some wavelet 
functions, so I need to plot values against time and scale.  I've generated 
three numpy arrays: X (time), Y (scale) (generated these using meshgrid), and Z 
(values, a rather sparse matrix).  I verified that all of these are the same 
shape (7x100) by fetching the 'shape' attribute from X,Y,Z.   However, when I 
call plot_wireframe(), I get this error:
 
Exception in Tkinter callback
Traceback (most recent call last):
  File C:\Python26\lib\lib-tk\Tkinter.py, line 1410, in __call__
    return self.func(*args)
  File C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py, 
line 212, in resize
    self.show()
  File C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py, 
line 215, in draw
    FigureCanvasAgg.draw(self)
  File C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py, line 
314, in draw
    self.figure.draw(self.renderer)
  File C:\Python26\Lib\site-packages\matplotlib\artist.py, line 46, in 
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File C:\Python26\lib\site-packages\matplotlib\figure.py, line 773, in draw
    for a in self.axes: a.draw(renderer)
  File C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py, line 
135, in draw
    for col in self.collections]
  File C:\Python26\Lib\site-packages\mpl_toolkits\mplot3d\art3d.py, line 163, 
in do_3d_projection
    self._segments3d]
  File C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\proj3d.py, line 
211, in proj_trans_points
    return proj_transform(xs, ys, zs, M)
  File C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\proj3d.py, line 
193, in proj_transform
    vec = vec_pad_ones(xs, ys, zs)
  File C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\proj3d.py, line 
184, in vec_pad_ones
    vec = np.array([xs,ys,zs,np.ones((len(xs)))])
ValueError: setting an array element with a sequence.
 
Any suggestions as to what the problem might be?  As I said, I'm having 
problems duplicating it in toy programs.
 
Thanks in advance.
 
/s/
Pat --
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users