This slightly modified excerpt from the new version of spy may do what 
you want:

nr, nc = Z.shape
extent = [-0.5, nc-0.5, nr-0.5, -0.5]
return self.imshow(Z, interpolation='nearest',
                        extent=extent, origin='upper')

Eric


John Travers wrote:
> Hi, I'm struggling to get an array plotted the way I want with imshow.
> I have an array A which i try to plot with
> 
> e=(tdims[0], tdims[-1], wldims[-1], wldims[0])
> imshow(A,extent=e)
> 
> The image displays fine in the x axis, with tdims marked correctly,
> but in the yaxis the dimensions are incorrect. And no combination of
> extent and origin gives the correect display. To be more clear,
> without extent set I get the array displayed the right way round, but
> my problem is that my y axis should be *decreasing* as it goes up the
> side of the image; if I set extent correctly, the image is scaled
> right with respect to the y axis, but it is flipped so that the y axis
> is increasing upwards. Is there a way to prevent this?
> 
> Many thanks for any help!
> Ans thanks for an excellent plotting library!
> 
> Best regards
> John
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to