Canvas change events?

Briefly, is there a way to get a callback in the event that the canvas has been redrawn (e.g. from a zoom or pan)?

matplotlib 0.86.2
python 2.4.1
Mac OS X.4.7

I draw a circle at a certain point. I let the user drag that point to a new location. However, if the plot is redrawn for any reason, I have to redraw my circle in a new position. I can't seem to find any way to get notified of a redraw.

Figure.add_axobserver() isn't fully implemented as far as I can tell since it only notifies for a artist deletion or a call to sca().
Axes.connect() doesn't work either because there's no way to set emit in a class-wide scope and consequently calls made to set_xlim made by the toolbar do not trigger an event because they lack the emit keyword in their calls. Here's the relevant code from

   def set_xlim(self, *args, **kwargs):
         # .....
         emit = popd(kwargs, 'emit', False)
         # .....
         if emit: self._send_xlim_event()
         return vmin, vmax

I've been trying to accomplish this without editing matplotlib package code. Is there a way I could override Axes.set_xlim() in order to insert "emit=True" into the arguments?

Maybe there's a better way to do what I'm doing?



PGP.sig (186 Bytes)