Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
DOC: simplify histogram animation example#27620
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
😄
Can't decide if helpful or out of scope to also show updating a histogram using ArtistAnimation
This can be merged if/when CI passes. |
The animation is no longer showing in the built docs, just a static image. Any ideas how I broke that? |
story645 commentedJan 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
So my guess is that the reason for the wrapper function is b/c otherwise sphinx gallery is losing the figure/global that's in the other cell. 🤦♀️ yeah, see how in the current the figure is created in the same block as the call to the animation functionhttps://matplotlib.org/devdocs/gallery/animation/animated_histogram.html#sphx-glr-gallery-animation-animated-histogram-py |
Thanks@story645 I have moved the figure and artists setup back to the last cell andthe animation works again. I think it is a bit less intuitive this way round, but still good to remove the unnecessary complication of the wrapper function. |
story645 commentedJan 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
So I just realized this could maybe be a good place to demo how we can pass arguments to animation update functions using partial: But also not a blocker, current globals is fine too/ I can do as follow up. |
I like this. It feels more intuitive given the order of cells in the example. Also we already have theline animation to demonstrate the absolute simplest way of doing it. |
…620-on-v3.8.xBackport PR#27620 on branch v3.8.x (DOC: simplify histogram animation example)
…620-on-v3.8.2-docBackport PR#27620 on branch v3.8.2-doc (DOC: simplify histogram animation example)
Uh oh!
There was an error while loading.Please reload this page.
PR summary
I might be missing something but the function-returning-a-function approach used here seems unnecessarily complicated to me. We can just have our
animate
function update the globalBarContainer
object.While I was in there I also
default_rng
, per#25765(comment)PR checklist