From: anirudh v. <ani...@gm...> - 2008-07-09 14:35:57
|
Hi, First off, I'd like to congratulate the devs who wrote the 3D plotting module. Its great and fits a lot of my plotting needs without resorting to vtk, mayavi etc. But I've had some issues with 3D plots 1. If i do a ---- import pylab as p import matplotlib.axes3d as p3 fig=p.figure() ax = p3.Axes3D(fig) ax.scatter3D(ravel(x),ravel(y),ravel(z)) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') p.show() ---- then things work well. But if I do an "from pylab import *", the plot command does'nt work. Any ideas? 2. In the scatterplot, as well as other 3D plots, I would like to plot different datasets with different colors. While in plot(), "r." etc change color, in plot3d etc the option does'nt work. So, is there a way to use different colors in the same plot. 3. Is there any documentation on the 3D plotting functions. There are examples at http://scipy.org/Cookbook/Matplotlib/mplot3D, but I could'nt find any documentation on function calls, options etc. help(plot3d) just says plot3d(**args) without any other info. cheers, anirudh. |
From: Darren D. <dsd...@gm...> - 2008-07-09 14:55:03
|
On Wednesday 09 July 2008 10:35:55 am anirudh vij wrote: > Hi, > > First off, I'd like to congratulate the devs who wrote the 3D plotting > module. Its great and fits a lot of my plotting needs without > resorting to vtk, mayavi etc. > > But I've had some issues with 3D plots I'm sorry to disappoint, but 3D plotting has been unsupported for a long time and was recently removed from the mpl codebase. > 1. If i do a > ---- > import pylab as p > import matplotlib.axes3d as p3 > fig=p.figure() > ax = p3.Axes3D(fig) > ax.scatter3D(ravel(x),ravel(y),ravel(z)) > ax.set_xlabel('X') > ax.set_ylabel('Y') > ax.set_zlabel('Z') > p.show() > ---- > > then things work well. probably because you have an old version of axes3d.py in your installation directory... > But if I do an "from pylab import *", > the plot command does'nt work. Any ideas? ... but pylab.py knows that we dropped 3d support so it doesnt try to import it anymore. Darren |
From: Darren D. <dsd...@gm...> - 2008-07-09 16:32:45
|
On Wednesday 09 July 2008 11:59:50 am anirudh vij wrote: > On Wed, Jul 9, 2008 at 4:54 PM, Darren Dale <dsd...@gm...> wrote: > > On Wednesday 09 July 2008 10:35:55 am anirudh vij wrote: > >> Hi, > >> > >> First off, I'd like to congratulate the devs who wrote the 3D plotting > >> module. Its great and fits a lot of my plotting needs without > >> resorting to vtk, mayavi etc. > >> > >> But I've had some issues with 3D plots > > > > I'm sorry to disappoint, but 3D plotting has been unsupported for a long > > time and was recently removed from the mpl codebase. > > This is horrible. How do I do 3D plots now? > Mayavi svn crashes when called from python. We have been warning that 3D plotting was unsupported and needed someone to volunteer to maintain it for quite a while now. Nobody answered the call, and 3d capabilities did not survive the transition to the new transforms in mpl-0.98, so it was removed, However... [...] > matplotlib version is 0.91.2, straight from ubuntu repos. 3D support should still be present in 0.91.x. I just did a clean install of 0.91.4 from svn, and this works: import pylab as p import matplotlib.axes3d as p3 fig=p.figure() ax = p3.Axes3D(fig) p.show() I haven't used matplotlib's 3d capabilities, so I dont know how you expected to work with "from pylab import *" instead of the above. Perhaps you could give a short explicit example of what used to work and now does not. Darren |
From: anirudh v. <ani...@gm...> - 2008-07-09 16:40:31
|
> We have been warning that 3D plotting was unsupported and needed someone to > volunteer to maintain it for quite a while now. Nobody answered the call, and > 3d capabilities did not survive the transition to the new transforms in > mpl-0.98, so it was removed, However... > hmm. Mayavi2 has a mlab module thats under active development. It aims to do the same stuff that matlab 3D plots do. However, svn currently crashes for me. > [...] >> matplotlib version is 0.91.2, straight from ubuntu repos. > > 3D support should still be present in 0.91.x. I just did a clean install of > 0.91.4 from svn, and this works: > > import pylab as p > import matplotlib.axes3d as p3 > fig=p.figure() > ax = p3.Axes3D(fig) > p.show() > > I haven't used matplotlib's 3d capabilities, so I dont know how you expected > to work with "from pylab import *" instead of the above. Perhaps you could > give a short explicit example of what used to work and now does not. ----- from pylab import * import matplotlib.axes3d as p3 fig=figure() ax= p3.Axes3D(fig) ax.scatter3D(x,y,z) show() ----- this causes an error. x,y,z are valid 1D arrays. They work using the method you've posted in your mail. Perhaps a wrapper can be wriitten around mayavi's mlab module. 3D plotting is too important to leave out of something like matplotlib. Its perfect for all other things. It would be a pity if one has to switch to gnuplot or dislin just for 3D. |
From: Darren D. <dsd...@gm...> - 2008-07-09 16:59:07
|
On Wednesday 09 July 2008 12:40:29 pm anirudh vij wrote: > > We have been warning that 3D plotting was unsupported and needed someone > > to volunteer to maintain it for quite a while now. Nobody answered the > > call, and 3d capabilities did not survive the transition to the new > > transforms in mpl-0.98, so it was removed, However... > > hmm. Mayavi2 has a mlab module thats under active development. It aims > to do the same stuff that matlab 3D plots do. However, svn currently > crashes for me. > > > [...] > > > >> matplotlib version is 0.91.2, straight from ubuntu repos. > > > > 3D support should still be present in 0.91.x. I just did a clean install > > of 0.91.4 from svn, and this works: > > > > import pylab as p > > import matplotlib.axes3d as p3 > > fig=p.figure() > > ax = p3.Axes3D(fig) > > p.show() > > > > I haven't used matplotlib's 3d capabilities, so I dont know how you > > expected to work with "from pylab import *" instead of the above. Perhaps > > you could give a short explicit example of what used to work and now does > > not. > > ----- > from pylab import * > import matplotlib.axes3d as p3 > fig=figure() > ax= p3.Axes3D(fig) > ax.scatter3D(x,y,z) > show() > ----- > this causes an error. I can't help much if you don't tell me what the error is. I just ran the following and I did not observe any error: from pylab import * x=rand(100) y=rand(100) z=rand(100) import matplotlib.axes3d as p3 fig=figure() ax= p3.Axes3D(fig) ax.scatter3D(x,y,z) show() > x,y,z are valid 1D arrays. They work using the > method you've posted in your mail. > > Perhaps a wrapper can be wriitten around mayavi's mlab module. 3D > plotting is too important to leave out of something like matplotlib. > Its perfect for all other things. It would be a pity if one has to > switch to gnuplot or dislin just for 3D. It sounds like a good idea to me. Submissions are very welcome. Darren |
From: Bryan C. <br...@co...> - 2008-07-10 10:18:51
|
On Wed, 2008-07-09 at 18:40 +0200, anirudh vij wrote: > > We have been warning that 3D plotting was unsupported and needed someone to > > volunteer to maintain it for quite a while now. Nobody answered the call, and > > 3d capabilities did not survive the transition to the new transforms in > > mpl-0.98, so it was removed, However... > > > > hmm. Mayavi2 has a mlab module thats under active development. It aims > to do the same stuff that matlab 3D plots do. However, svn currently > crashes for me. An alterative to mpl/mayavi for 3d is Pyx (see http://pyx.sourceforge.net/examples/3dgraphs/color.html ), although it's not interactive. BC |