zoomhistory, zoom to rectangle

Hello,

one of Matplotlib's greatest advantage (besides the great graphics of
course) is the ability to zoom in into plotted curves. The zoomhistory is
thereby a very good and useful tool.
I figured out two things:

1) Unfortunetly this history seems not to work properly in some cases. I
was able to track down this error on the call of the subplot-command (see
example below).
Is this a little bug or am I using those commands in a way they are not
supposed to be used?

2) If the built-in zoomfunction "zoom to rectangle" is used too "hectic"
(i.e. the mouse is still moving when the button is released) the zoom is
done but not shown. Therefor one can see the just drawn
rectangles.

Bye,
Martin

···

#-----------------------------------------------------------------------------------
"""This program shows how the zoom-history is messed up by the usage of the
   subplot-command.
"""

from pylab import *

def click(event):
    """Plot a point.
    """
    if event.inaxes==subplot1 and event.button==1:
        x,y = event.xdata,event.ydata
        subplot(121,autoscale_on=False)
    # If those subplot-commands are commented out
    # the zoom-history will work properly.
    # (i.e. the home-function is defective,
    # only steps back untill the last click(event)-call
    # are possible.)
        plot([x],[y],'ro')
        subplot(122,autoscale_on=False)
        plot([x],[y],'go')
        draw()

t=arange(100)/99.0
subplot2 = subplot(122,autoscale_on=False)
plot(t,.5*(sin(2*pi*t)+1))
subplot1 = subplot(121,autoscale_on=False)
plot(t,t**2)
axis([0,1,0,1])
connect('button_press_event',click)
show()

--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse f�r Mail, Message, More +++