## matplotlib-users

 [Matplotlib-users] 3D plotting? From: william ratcliff - 2007-08-10 15:38:01 Attachments: Message as HTML ```Is there a way to choose the color map for doing scatter plots using Axes3D? In the test_scatter() example in the class, there is a line something like: ax.scatter3D(xs,ys,zs, c='r') I would like to plot points based on 3 dimensional coordinates specified by xs,ys, zs, which works great. However, I would like to color the points with a third array, for example, cs which would either specify an index in a color map, or even just an intensity of a given color. Is this possible within matplotlib? Thanks, William ```
 Re: [Matplotlib-users] 3D plotting? From: Matthieu Brucher - 2007-08-10 17:51:25 Attachments: Message as HTML ```2007/8/10, william ratcliff : > > so it would be something like: > > > c=numpy.array([[1,2,3],[0,0,4],[0,2,4]]), where the values in the array go > from 0-255 and denote r,g,b values? > > Thanks! I use floatting point values, don't know if integers work. I thing that colormap could be used, but I really don't know, I do not use them. Matthieu ```
 Re: [Matplotlib-users] 3D plotting? From: Eric Firing - 2007-08-10 18:10:33 ``` 3D plotting in mpl is unmaintained, so I don't recommend relying on it unless you can bring it up to date and maintain it. After committing a bugfix to svn, the following works with svn mpl and does something like what you want (but might not work with whatever version of mpl you are using.) ---------------------------------- from pylab import * from matplotlib import axes3d N = 30 x = 0.9*rand(N) y = 0.9*rand(N) z = rand(N) c = rand(N) area = pi*(10 * rand(N))**2 # 0 to 10 point radiuses fig = gcf() ax3d = axes3d.Axes3D(fig) plt = fig.axes.append(ax3d) ax3d.scatter(x,y,z,s=area, marker='^', c=c) show() ----------------------------------------- A more general problem is that a 3D scatter plot is ambiguous--how do you know where a point really is in 3D? You would have to do something like mapping color to Z. Is that what you want to do? Eric william ratcliff wrote: > Is there a way to choose the color map for doing scatter plots using > Axes3D? In the test_scatter() example in the class, there is a line > something like: > > ax.scatter3D(xs,ys,zs, c='r') > > I would like to plot points based on 3 dimensional coordinates specified > by xs,ys, zs, which works great. However, I would like to color the > points with a third array, for example, cs which would either specify an > index in a color map, or even just an intensity of a given color. Is > this possible within matplotlib? > > Thanks, > William > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```