Hi
I have been trying to plot a matrix and want to start from top left
corner. I tried to use 'matshow' and it worked the way I wanted but
that could not satisfy other needs like I needed to plot something
else over the matrix and also needed shading='faceted' which I could
not set using matshow
So I tried to use 'pcolor' where shading is faceted by default and I
could plot other stuff on top ofI the matrix image but I could not get
the origin='upper' working with pcolor. I also tried with imshow but
it did the same thing.
I tried both lower and upper values and results come out same the
array starts plotting from bottom left.
I am using 0.87.6 and python 2.4.3
Has anybody seen this problem ? Is there usage error?
Khem Raj wrote:
Hi
I have been trying to plot a matrix and want to start from top left
corner. I tried to use 'matshow' and it worked the way I wanted but
that could not satisfy other needs like I needed to plot something
else over the matrix and also needed shading='faceted' which I could
not set using matshow
matshow calls imshow.
You should be able to plot on top of an image made by matshow or imshow, so I don't know what the problem was with that.
So I tried to use 'pcolor' where shading is faceted by default and I
could plot other stuff on top ofI the matrix image but I could not get
the origin='upper' working with pcolor. I also tried with imshow but
it did the same thing.
pcolor does not have an 'origin' kwarg but imshow does, so I don't understand your last sentence above.
For pcolor you need to either rearrange your matrix (e.g., 'pcolor(flipud(Z))') or call pcolor with X and Y arguments as well as Z.
Eric