I would like to plot a masked array with plot_surface().
But unlike imshow() which really plots the masked data,
plot_surface() only plots the non-masked data.

How can I plot the masked array?

Ciao
Andreas



import numpy as np
import pylab as mpl
from mpl_toolkits.mplot3d import axes3d

x = np.arange(1,10,1)
y = np.arange(1,10,1)
x,y = np.meshgrid(x,y)
z = x**3 + y**3 - 500
z = np.ma.masked_array(z, z<0)

cm = mpl.cm.jet

ax1 = mpl.subplot(1,2,1, projection='3d')
ax1.plot_surface(x,y,z,
                 rstride=1, cstride=1, linewidth=0,
                 cmap=cm)

ax2 = mpl.subplot(1,2,2)
ax2.imshow(z, cmap=cm)

mpl.show()


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to