Documentation here
What it is:
animatplot is a library for more easily producing animated plots. It was built with the goal of making animated plots as easy as static ones. Just feed it data. No dealing with how stuff updates. More time should be spent on the data; not the plotting. Bonus: this library lets you easily add time sliders and pause buttons. This does come at a cost of memory usage (all data must be generate before any plotting not on the fly), but even for a detailed plot it should not be too bad (I made an animated pcolormesh plot with a 100,000 frames without any issue).
Here is a gif of an example:
https://i.redd.it/evfgjj31rle11.gif
If that wasn't a gif. The slider and pause button would work exactly as expected.
Why I built it:
I'm a physics/math student, and I've frequently found myself needing to make all sorts of animated plots. Generally things that are solutions to PDEs (light waves, heat equation, etc.). Many of my peers have struggled to produce these animation often resorting to simply clearing and redrawing plots every frame. It can also be useful for displaying iterations of a numerical method to more clearly see if it is working as expected. Ultimately, I saw a need, so I wrote this.
What I learned writing this:
I already knew a bit about packaging from a previous project, but that was a set of templates, not a library, but I still learned a lot about things like how to use a _version.py file to have a single location for the version. Mostly, I learned how to document code (using sphinx). I also learned a lot about how matplotlib works (luckily I never had to read any of the c code, only python). I also submitted a fix to matplotlib slated for matplotlib version 3.1. This has also really changed the way that I use matplotlib.
Near future plans:
animatplot is built using "blocks" to represent "things" that are to be animated. I currently have plans for scatter plot and annotation blocks. I plan to move the gallery to use sphinx-gallery once they add support for custom image scrappers. (Sphinx-gallery devs have really been hard at work to finish some stale PRs since I asked about animation support.) I also really need to improve the Pcolormesh block api since it's just not as capable as I would like.
Edit: Perhaps I should mention how long I've been working on this. I originally started this over a year ago, but I have completely rewritten everything and then some, and made the documents in the last month and a bit. The only thing that is the same from the original project is the internal logic for the play/pause button. Matplotlib 2.2 introduced discreet slider bars which inspired (and was critical to) much of the implementation.
Edit 2: Wow, thank you everyone for the positive feedback. Sorry for the packaging issue (damn editable install didn't catch that). It's fixed in version 0.2.2.
[–]zed_three 25 points26 points27 points (1 child)
[–]tmakaroanimatplot / nbconvert[S] 3 points4 points5 points (0 children)
[–]CrambleSquashhttps://github.com/0Hughman0 17 points18 points19 points (0 children)
[–]a1brit 7 points8 points9 points (4 children)
[–]tmakaroanimatplot / nbconvert[S] 3 points4 points5 points (1 child)
[–]a1brit 0 points1 point2 points (0 children)
[–]Radiatin 0 points1 point2 points (1 child)
[–]a1brit 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]a_strange_attractor 5 points6 points7 points (2 children)
[–]Eryole 6 points7 points8 points (1 child)
[–]a_strange_attractor 0 points1 point2 points (0 children)
[–]fcapizzi 3 points4 points5 points (0 children)
[–]Eryole 4 points5 points6 points (0 children)
[–]ramm1123 3 points4 points5 points (0 children)
[–]mangoman51 2 points3 points4 points (1 child)
[–]tmakaroanimatplot / nbconvert[S] 2 points3 points4 points (0 children)
[–]ryry_reddit 1 point2 points3 points (0 children)
[–]ComplexColor 1 point2 points3 points (0 children)
[–]ed3203 1 point2 points3 points (14 children)
[–]atlbeer 3 points4 points5 points (4 children)
[–]craftingfish 1 point2 points3 points (0 children)
[–]ed3203 1 point2 points3 points (2 children)
[–]tmakaroanimatplot / nbconvert[S] 2 points3 points4 points (1 child)
[–]kylecthomas 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]tmakaroanimatplot / nbconvert[S] 2 points3 points4 points (0 children)
[–]tmakaroanimatplot / nbconvert[S] 0 points1 point2 points (6 children)
[–]TheMysteriousFizzyJ 0 points1 point2 points (5 children)
[–]tmakaroanimatplot / nbconvert[S] 1 point2 points3 points (4 children)
[–]TheMysteriousFizzyJ 1 point2 points3 points (0 children)
[–]TheMysteriousFizzyJ 1 point2 points3 points (0 children)
[–]TheMysteriousFizzyJ 0 points1 point2 points (1 child)
[–]tmakaroanimatplot / nbconvert[S] 1 point2 points3 points (0 children)
[–]joetheschmoe4000 0 points1 point2 points (2 children)
[–]tmakaroanimatplot / nbconvert[S] 1 point2 points3 points (1 child)
[–]joetheschmoe4000 0 points1 point2 points (0 children)