animatplot
animatplot copied to clipboard
More blocks
I'm opening a bunch of issues just to track progress.
This one is for new blocks!
The following have methods to update data which makes them prime candidates for blocks.
- [x] Scatter plots
- [ ] Annotations
More blocks
- [ ] A block to shift the x/y-limits of an axis would be nice.
- [x] A title block
- [x] Update block (similar to the Nuke block but it doesn't clear the axes which allows for people to write a larger variety of custom updating blocks.)
The following blocks would be nice, but matplotlib doesn't have update methods for them.
- [ ] histograms
- [ ] pie charts
Any update on this by chance? Came back to this hoping to animate some scatter plot data.
I actually have most of the scatter plot block written. It can animate the points' location and size, but not the color. I've been considering cutting a release with all my improvements up to this point (maybe next weekend? I've been busy).
Animating contour plots would also be nice, this stackoverflow post seems to show that it is possible.
(Also title block is done)
The trick in that stack overflow post of creating and deleting artists is intriguing. Great care would need to be taken to not have a memory leak.
How about a colorbar block? At the moment the colorbar must be static, but at some point someone might want to use a colorbar whose limits evolve with the data?
Hey @t-makaro great library! The usage of FuncAnimation
to implement a play button is super clever.
I've been building a similar library mpl-interactions and also have a list like yours (https://github.com/ianhi/mpl-interactions/issues/59). I'm hoping we can share some of the figuring out of how to update various matplotlib elements. For example:
implementing hist
:
I ended up implementing my own using a PatchCollection
and I'd be happy to have it included in animatplot (see: https://github.com/ianhi/mpl-interactions/blob/0c6508cafee0c7e709d1d8ef9f12a3dadef70558/mpl_interactions/pyplot.py#L400-L419)
Also, in matplotlib 3.4 there will be a stairs
method https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.stairs.html?highlight=stairs#matplotlib.axes.Axes.stairs which can create generic histogram like objects that have a set_data
method (implemented in https://github.com/matplotlib/matplotlib/pull/18275)
re library similarity:
Our libraries accomplish similar goals but definitely have substantive differences such that I think we don't really infringe on eachother and can coexist happily :)
animatplot
is much easier to save a gif from and works natively with arrays. Whereas mpl_interactions
considers functions to be fundamental object that gets plotted and puts half of the focus onto ipywidgets
.
Given my reliance on ipywidgets I probably would have made my library even if I'd been aware of animatplot
earlier but back this summer when I started work I actually thought animatlplot was only for animations, I didn't realize it could be used interactively. I think that I was fooled by animatplot
only being placed under the Animations
section of the matplotlib 3rd party packages list. I think you have a real claim to also be listed under the Interactions
heading. If you open a PR there adding a link to the interactions section as well I'd show up an argue for it.