Skip to content

Animation example: rain drops #3050

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

Merged
merged 7 commits into from
May 14, 2014
Merged

Conversation

rougier
Copy link
Member

@rougier rougier commented May 7, 2014

This is an example for the animation function displaying rain drops (kind of).

The animation is made using a scatter plot. Each drop is shown as a growing and fading disc.
In the example, there are 50 simultaneous rain drops anytime.
The use of the TkAgg backend is necessary on OSX.

It is meant to replace PR #3048 to avoid basemap dependency.

import matplotlib
import numpy as np
matplotlib.use('TkAgg')
matplotlib.rcParams['toolbar'] = 'None'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this example as simple as possible. So let's get rid of some of these lines (we will also need to get rid of "blit=True" in order for animations to work for macosx backend, I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed extra lines but keep the TkAgg and blit=True or it does not work on OSX.

@tonysyu
Copy link
Contributor

tonysyu commented May 8, 2014

Sorry, this isn't a constructive comment, but... This is really cool!

@tacaswell tacaswell added this to the v1.4.0 milestone May 8, 2014
@rougier
Copy link
Member Author

rougier commented May 8, 2014

Thanks.

@pelson
Copy link
Member

pelson commented May 8, 2014

This is really great. I've updated the code to be a little more explicit in b79cd64 which I think might be worth pulling into this PR.
I've also added another commit which spawns the raindrops based on the mouse position, I don't propose that your example use it, but for curiosity af924e7. Both commits are in my rain_anim branch (https://github.com/pelson/matplotlib/commits/rain_anim).

@rougier
Copy link
Member Author

rougier commented May 8, 2014

I also did a mouse-based demo but finally found the simple rain more peaceful and mesmerizing...

@pelson
Copy link
Member

pelson commented May 9, 2014

Agreed. If you're happy to do so, please consider incorporating my stylistic changes, and I'll be happy to merge this. Great example, thanks @rougier.

@rougier
Copy link
Member Author

rougier commented May 9, 2014

Stupid question: what would be the magic git command to merge your changes in my PR ?
(or should I do it by hand ?)

@pelson
Copy link
Member

pelson commented May 12, 2014

I've made a pull request if that makes it easier:
rougier#1

Alternatively, it would be a case of adding my repo as a remote, and cherry picking the specific commit (0b26ad3).

@rougier
Copy link
Member Author

rougier commented May 13, 2014

Merged, but Travis failed.

@tacaswell
Copy link
Member

wonderful, the font priority issue has migrated to 3.3 as well. Those failures are known and can be ignored.

@tacaswell
Copy link
Member

@pelson Do you want to do the honors?

pelson added a commit that referenced this pull request May 14, 2014
Animation example: rain drops
@pelson pelson merged commit 6ac203f into matplotlib:master May 14, 2014
@rougier rougier deleted the example-rain branch June 4, 2014 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants