## matplotlib-users

 [Matplotlib-users] 3D layered plot From: Marston - 2012-04-05 08:47:47 ```This plot is possible in MATLAB but I would like to do this in matplotlib. See attached fig. In matlab the code is: a=peaks(20); b=peaks(20)+2*rand(20); c=rand(20); figure; hold on; ha=pcolor(a); hb=pcolor(b); hc=pcolor(c); set(hb,'zdata',0*b+5) set(hc,'zdata',0*c+10) This plot can then be rotated, as is done in the figure, to what I want to accomplish in matplotlib. http://old.nabble.com/file/p33568798/set_matlab_image.jpg set_matlab_image.jpg Is this possible, if so, how? -- View this message in context: http://old.nabble.com/3D-layered-plot-tp33568798p33568798.html Sent from the matplotlib - users mailing list archive at Nabble.com. ```
 Re: [Matplotlib-users] 3D layered plot From: Moore, Eric (NIH/NIDDK) [F] - 2012-04-05 12:32:36 ```It sort of is: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import mpl_toolkits.mplot3d.art3d as art3d import numpy as np x, y = np.mgrid[0:2*np.pi:16j, 0:2*np.pi:16j] C = np.cos(2*x[:-1,:-1]) + np.sin(y[:-1,:-1]) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') p = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(p, 0) q = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(q, 5) o = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(o, 10) ax.set_xlim([x[0,0], x[-1,0]]) ax.set_ylim([y[0,0], y[0,-1]]) ax.set_zlim([0,10]) plt.show() -Eric > -----Original Message----- > From: Marston [mailto:shejo284@...] > Sent: Thursday, April 05, 2012 4:48 AM > To: matplotlib-users@... > Subject: [Matplotlib-users] 3D layered plot > > > This plot is possible in MATLAB but I would like to do this in > matplotlib. > See attached fig. > In matlab the code is: > > a=peaks(20); > b=peaks(20)+2*rand(20); > c=rand(20); > figure; hold on; > ha=pcolor(a); > hb=pcolor(b); > hc=pcolor(c); > set(hb,'zdata',0*b+5) > set(hc,'zdata',0*c+10) > > This plot can then be rotated, as is done in the figure, to what I want > to > accomplish in matplotlib. > http://old.nabble.com/file/p33568798/set_matlab_image.jpg > set_matlab_image.jpg > > Is this possible, if so, how? > > -- > View this message in context: http://old.nabble.com/3D-layered-plot- > tp33568798p33568798.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ----------------------------------------------------------------------- > ------- > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] 3D layered plot From: Marston Johnston - 2012-04-05 13:10:42 ```Hi Eric, For some reason I cannot see your post on the webpage but I get your emails. My python doesn't have: art3d.poly_collection_2d_to_3d() Is this an old function that has been deprecated? I'm using matplotlib version 1.1.0 /M On Apr 5, 2012, at 10:47 AM, Marston wrote: > > This plot is possible in MATLAB but I would like to do this in matplotlib. > See attached fig. > In matlab the code is: > > a=peaks(20); > b=peaks(20)+2*rand(20); > c=rand(20); > figure; hold on; > ha=pcolor(a); > hb=pcolor(b); > hc=pcolor(c); > set(hb,'zdata',0*b+5) > set(hc,'zdata',0*c+10) > > This plot can then be rotated, as is done in the figure, to what I want to > accomplish in matplotlib. > http://old.nabble.com/file/p33568798/set_matlab_image.jpg > set_matlab_image.jpg > > Is this possible, if so, how? > > -- > View this message in context: http://old.nabble.com/3D-layered-plot-tp33568798p33568798.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] 3D layered plot From: Moore, Eric (NIH/NIDDK) [F] - 2012-04-05 13:51:48 ```> -----Original Message----- > From: Marston Johnston [mailto:shejo284@...] > Sent: Thursday, April 05, 2012 9:11 AM > To: matplotlib-users@... > Subject: Re: [Matplotlib-users] 3D layered plot > > Hi Eric, > > For some reason I cannot see your post on the webpage but I get your > emails. > My python doesn't have: art3d.poly_collection_2d_to_3d() > Is this an old function that has been deprecated? I'm using matplotlib > version 1.1.0 > > /M > I'm also running matplotlib version 1.1.0. Perhaps someone else can comment, but as far as I know poly_collection_2d_to_3d is part of version 1.1.0. How does it fail when you try to run the example I gave? Can you import mpl_toolkits.mplot3d.art3d? ```