inverting y axis?

Simple question: how can I plot something such that the y axis is "inverted"? (Increasing downwards?)

(I thought I'd better ask before fubaring my copy of mpl's transAxes, transData, bbox code and going insane in the process.)

Cheers!
Andrew

Andrew Straw wrote:

Simple question: how can I plot something such that the y axis is "inverted"? (Increasing downwards?)

Simple answer:

ymin,ymax= get(gca(),'ylim')
set(gca(),'ylim',[ymax,ymin])

Now, on to determine how to plot an image with origin='upper' with the extent going the other way...

Cheers!
Andrew

Andrew Straw wrote:

Now, on to determine how to plot an image with origin='upper' with the extent going the other way...

Again, a no brainer:

(modifications to image_demo3.py)

w,h = lena.size
extent = 0,w,h,0
figure(figsize=figsize)

im = imshow(lena, origin='upper', aspect='preserve', extent=extent)