New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Artists not in Axes can not be animated with blit=True by FuncAnimation #11135
Comments
The error above does not actually show any error. But probably it's something like " Blitting blits the axes, not the complete figure. The least that can be done here is for sure to add a sentence in the docs that figure artists are not supported by blitting. Apart, I'm unsure if blitting should be extended to use the figure instead of the axes. One could probably use the figure bbox instead of the axes to save and restore for blitting; I'm not sure in how far this makes things less efficient (of course a larger image takes longer to restore). |
@ImportanceOfBeingErnest yes, I had only copied part of the error message by mistake (microsoft/vscode#18788). I have updated the original post. The error message is indeed |
Hi, thanks for raising this. I was also trying to blit some text but it didn't work. Any alternative solutions? I am not thinking of making images separately and combining them as a gif. |
@sahmed95 The issue here is that text outside of the axes is not updated in the blitting process. You may easily use text within the axes instead. You may also manually blit the text if needed, or write your custom animation to blit the complete figure instead of the axes. If however the aim is to create a gif, blitting is not useful at all (a saved image will always draw each frame in completeness), hence you can simply set |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
This still does raise, though at a (very) slightly different line of code:
Fundamentally, it comes down to the Even if the initial fix of averting the error were implemented, it is not clear to me that the expected behavior would happen, as there is no "blit over the whole figure" code in Perhaps the course of action here is to simply raise a more informative error if fig-based text cannot be blitted properly, or to special case the bbox for text (though that in and of itself gets complicated because the bbox changes). |
has there been any fix for the issue ? I have a similar error myself with the _blit_draw's |
Bug report
Bug summary
Text cannot be animated with blit=True. Code works fine with blit=False.
Code for reproduction
Actual outcome
This error:
Expected outcome
A plot with suptitle 0.
Matplotlib version
Python from https://www.python.org/
Matplotlib using pip
The text was updated successfully, but these errors were encountered: