Hi,
I'm trying to use pcolor on a masked array. I would like masked elements
to show up in a special color. I have written some code, but it does not
seem to work:
I would appreciate any help :)
Cheers,
Andreas.
---8<-------
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy import linspace
from numpy.random import randn
from numpy.ma import masked_invalid
D = randn(12*72).reshape((12,72))
D[4,:] = nan
D[6,6] = nan
D = masked_invalid(D)
cmap = mpl.cm.bwr
cmap.set_bad('k', 1.)
xbin = linspace(0, 12, 13)
ybin = linspace(-90, 90, 73)
fig = plt.figure()
spl = fig.add_subplot(111)
pl = spl.pcolor(xbin, ybin, D.T, cmap=cmap, edgecolors='none',
vmin=-5, vmax=5)
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users