Hello everyone,
although I thought this topic had been discussed earlier I wasn't able to find
it in the archives. So please forgive me if I'm repeating something. Here the
question I'm not able to answer on my own:
Is there a possibility to disconnect an event when someone wants to use the
zoom-to-rectangle mechanism so that the code which originally would be
executed on the event isn't actually executed as long as the zooming is
activated? To have an example to talk about:
···
############
from pylab import *
def click(event):
"""If the left mouse button is pressed: draw a little square. """
if event.button==1 and event.inaxes:
x,y = event.xdata,event.ydata
plot([x],[y],'rs')
draw()
plot((arange(100)/99.0)**3)
gca().set_autoscale_on(False)
connect('button_press_event',click)
show()
############
If one runs this script and tries to use the zooming he will always add such a
little red square to the plot. Can this be prevented somehow?
Thanks for your help,
Martin