No opposition here. The "rationale" behind the original location was:
1) Easy way to make it properly dependent on the backend
2) Easy way to get a handle on a widget when necessary (for Tk and Wx IIRC)
However, these were reasons of ease of implementation (aka. laziness) on my
part, no real technical reasons that I recall (clearly, since your branch
works).
So, +1.
Ryan
On Fri, Apr 12, 2013 at 9:32 PM, Michiel de Hoon <[email protected]>wrote:
> Dear all,
>
> The animation code in matplotlib relies on timers to update the animated
> figures. Currently a new timer is created by calling new_timer on a canvas,
> as in
>
> >>> f = pylab.figure()
> >>> timer = f.canvas.new_timer()
>
> This seems a bit of a wrinkle. For example, you may want to associate a
> timer with multiple figures, or with no figure at all; also you may want to
> continue using a timer after a particular figure is closed.
>
> I would therefore propose to make timers independent of canvases.
> Something like this:
>
> >>> from matplotlib import events
> >>> timer = events.Timer()
>
> This has the additional advantage of making the different backends more
> similar to each other; in the current implementation some backends rely on
> the canvas when making a timer, while others ignore it.
>
> I have made a branch on github that does exactly this; see
> https://github.com/mdehoon/matplotlib/tree/Timer
> I have verified that the animation examples still work correctly with all
> backends.
>
> Any comments/suggestions/criticisms? If this seems a good idea, I can make
> a pull request.
>
> Best,
> -Michiel.
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Matplotlib-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel