|
From: Richard H. C. <hch...@3g...> - 2006-09-06 16:59:02
|
Thank you! I realized later how to do this when I realized that I
hadn't looked at the code for the canvases.
R.
On Aug 29, 2006, at 12:08 AM, John Hunter wrote:
>>>>>> "Richard" == Richard Harvey Chapman <hchapman-matplotlib-
>>>>>> us...@3g...> writes:
>
> Richard> Briefly, is there a way to get a callback in the event
> Richard> that the canvas has been redrawn (e.g. from a zoom or
> Richard> pan)?
>
> Richard> matplotlib 0.86.2 python 2.4.1 wxPython 2.6.2.1 Mac OS
> Richard> X.4.7
>
> Richard> I draw a circle at a certain point. I let the user drag
> Richard> that point to a new location. However, if the plot is
> Richard> redrawn for any reason, I have to redraw my circle in a
> Richard> new position. I can't seem to find any way to get
> Richard> notified of a redraw.
>
> Have you dried connecting to a draw_event?
>
> def ondraw(event):
> # do something
> pass
>
> fig.canvas.mpl_connect('draw_event', ondraw)
>
> FYI, the widgets module matplotlib.widgets is a good place to look for
> examples of mpl event handling, in addition to the class documentation
> in the Event hierarchy in
> http://matplotlib.sourceforge.net/matplotlib.backend_bases.html
>
> JDH
R.
|