Hi Andreas, 
Someone else, please correct me if I'm wrong, but I think the only way to do 
this is to provide your own "facecolors" map.  Pick your preferred color map 
and apply it to dataset B, then now use mplot3d 
plot_surface(X,Y,Z_A,facecolors=B_colors). 

Assuming you are running inside pylab or have done similar imports, the 
following example should work

-------------------------------------------
import mpl_toolkits.mplot3d.axes3d
x=arange(10)
y=arange(10)
x,y=meshgrid(x,y)

za=sin(np.deg2rad(x))+20*cos(np.deg2rad(y))
zb=x*25

colors=cm.jet(zb)

ax = gca(projection='3d')
surf = ax.plot_surface(x,y,za,rstride=1,cstride=1,facecolors=colors)
draw() #I'm not sure why the draw command is necessary… anyone?
-------------------------------------------

Note, plot_surface will apply shading by default, you can turn it off and just 
use your supplied colors using the shade=False keyword arg

ethan




On Oct 27, 2012, at 2:09 AM, Andreas Hilboll wrote:

> Hi, maybe matplotlib is capable of doing this:
> 
> I have two gridded datasets, A and B, for say Europe. Now I want to plot
> a 3d surface with the z-values given by dataset A. The surface should be
> colored using a given color palette and the values from dataset B.
> 
> Any ideas on how to do this are greatly appreciated =)
> 
> Cheers, Andreas.
> 
> ------------------------------------------------------------------------------
> WINDOWS 8 is here. 
> Millions of people.  Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to