Hi all,

I have a script that reads in mouse-click coordinates from an image.
I noticed that, with image extents specified, the axes flip whenever I
plot to them.

This snippet demonstrates the behaviour I see:

# -- START --

import pylab as P
import numpy as N

# Generate test pattern
x = N.arange(100).reshape(-1,1) + N.zeros(100)

def click(event):
    print "Mouse click at (%f,%f)" % (event.xdata,event.ydata)
    P.plot([event.xdata],[event.ydata],'o')
    P.draw()

P.imshow(x,extent=(0,x.shape[1],x.shape[0],0))
P.connect('button_press_event',click)
P.show()

# -- END --


Is this normal? If so, how do I get around the problem?  I also
noticed that, even without extents, the image gets scaled after
plotting.

I'd appreciate any advice!

Thanks for your time.
Stéfan

-------------------------------------------------------------------------
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