differnet colormaps with pcolormesh

Hi,

Is there a way to somehow squeeze two datasets with two different color
maps into one pcolormesh? Say one dataset occupies one triangle (e. g.
numpy.triu(dataset1, 1)) and the second dataset a different area (e. g.
numpy.tril(dataset2, -1)) and then paste the two datasets in one
pcolormesh (e.g. pylab.pcolormesh(numpy.triu(dataset1, 1) +
numpy.tril(dataset2, -1)) ). This will obviously share one colormap. But
does anybody know a trick to use two different ones?

TIA
Christian

PS Forgot to thank Eric Firing for his tip last time I asked. Thank you
Eric: You solved my problem!

I'm not exactly sure what you're trying to do. but I think what you
want can be easily achieved by simply using the masked array. Is the
example below similar to what you need?

a = np.arange(100).reshape((10,10))

m1 = np.triu(a, 1) > 0
m2 = np.tril(a, -1) > 0
#m2 = ~m1

am1 = np.ma.array(a, mask=m1)
am2 = np.ma.array(a, mask=m2)

pcolormesh(am1, cmap=plt.cm.jet)
pcolormesh(am2, cmap=plt.cm.gray)

-JJ

ยทยทยท

On Wed, Nov 11, 2009 at 12:11 PM, Christian Meesters <meesters@...2757...> wrote:

Hi,

Is there a way to somehow squeeze two datasets with two different color
maps into one pcolormesh? Say one dataset occupies one triangle (e. g.
numpy.triu(dataset1, 1)) and the second dataset a different area (e. g.
numpy.tril(dataset2, -1)) and then paste the two datasets in one
pcolormesh (e.g. pylab.pcolormesh(numpy.triu(dataset1, 1) +
numpy.tril(dataset2, -1)) ). This will obviously share one colormap. But
does anybody know a trick to use two different ones?

TIA
Christian

PS Forgot to thank Eric Firing for his tip last time I asked. Thank you
Eric: You solved my problem!

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options