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:shejo...@gmail.com]
> Sent: Thursday, April 05, 2012 4:48 AM
> To: matplotlib-users@lists.sourceforge.net
> 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@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to