I have two arrays and I want to plot the ratio of A/B when A>=B or B/A
when A<B.  I can create numpy masked arrays to find the result in
these two instances, but I'm having trouble plotting them.  Below I
have a minimal example.  I get a plot, but only from the second time I
issue the pcolormesh command.  Is there a way to combine the two
arrays for plotting or to plot without overlapping?

Thanks,
Jeremy



import numpy
import matplotlib.pyplot as pyplot

N = 5
A = numpy.array(numpy.random.randint(0, 10, (N,N)), dtype='float64')
B = numpy.array(numpy.random.randint(0, 10, (N,N)), dtype='float64')

ab = numpy.ma.masked_array(A/B, mask=A>=B, fill_value=0.0)
ba = numpy.ma.masked_array(B/A, mask=A<B)
Figure = pyplot.figure()
pyplot.pcolormesh(ab)
pyplot.pcolormesh(ba)

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to