Sorry for spamming, but I have another addition to
BlockingMouseInput.add_click, that fixes the problem of the graphics jumping
around while ginputting. This makes it much easier to zoom in on an imshow()
plot and click a bunch of points, for example (it used to zoom all the way
out!):

def add_click(self,event):
        """
        This add the coordinates of an event to the list of clicks
        """
        self.clicks.append((event.xdata,event.ydata))

        verbose.report("input %i: %f,%f" %
                       (len(self.clicks),event.xdata, event.ydata))

        # If desired plot up click
        if self.show_clicks:

            # make sure we don't mess with the axes zoom
            xlim = event.inaxes.get_xlim()
            ylim = event.inaxes.get_ylim()

            # plot the clicks
            self.marks.extend(
                event.inaxes.plot([event.xdata,], [event.ydata,], 'r+') )

            # before we draw, make sure to reset the limits
            event.inaxes.set_xlim(xlim)
            event.inaxes.set_ylim(ylim)
            self.fig.canvas.draw()
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to