Skip to content
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

New animation example (Joy Division's Unchained Love cover) #3099

Merged
merged 1 commit into from Jun 4, 2014

Conversation

rougier
Copy link
Member

@rougier rougier commented May 31, 2014

This is a (cool IMHO) plot animation inspired from the Joy Division Unchained Love cover.
It shows how to animate plots and how to simulate a cheap perspective effect.

I did it after answering this question on stack overflow.
http://stackoverflow.com/questions/23507217/python-plotting-2d-data-on-to-3d-axes/23968448#23968448

Nicolas

@tacaswell
Copy link
Member

@efiring Does this count as a new feature?

@efiring
Copy link
Member

efiring commented Jun 1, 2014

@tacaswell, if you are asking about the "feature freeze" aspect, it's borderline, but I would say a new example is harmless and can be included. For an animation, it would be best if it could be tested on a variety of gui backends and platforms prior to release.

@NelleV
Copy link
Member

NelleV commented Jun 3, 2014

Neat! I like it.

import matplotlib.animation as animation

# Create new Figure with black background
fig = plt.figure(figsize=(8,8))
Copy link
Member

Choose a reason for hiding this comment

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

Part of the code isn't pep8. Can you run pep8 on it, and fix the errors?
(Here, there should be a space after the coma)

@tacaswell
Copy link
Member

Can you also squash this down to one commit?

@rougier
Copy link
Member Author

rougier commented Jun 3, 2014

Sure (but I do not know the git magic command, will search).

@tacaswell
Copy link
Member

git fetch upstream and then git rebase -i upstream/master (assuming the remote that points at the canonical repo is called 'upstream') and follow the on-screen directions.

@tacaswell
Copy link
Member

and then a git push --force github assuming 'github' in the remote that points to your matplotlib repo on github.

@rougier
Copy link
Member Author

rougier commented Jun 3, 2014

Ok, it's a total mess, maybe the easiest at this point it to create a new PR, no ?
(I started some git recipes before reading your post, sorry)

@tacaswell
Copy link
Member

nah, it's savable (PRs on github point at branches so with force push you can save it).

git checkout unchained # make sure you are on the right branch
git reset --hard d8d28a7 # forcibly make the branch point at an earlier commit
git rebase -i upstream/master # do the rebase + squash

follow directions: put 's' before all of the commits but the first one, this should go smoothly

git push github # this will not work, but you should read the error message
git push --force github unchained # clobber what github thinks this branch points at

@rougier
Copy link
Member Author

rougier commented Jun 3, 2014

Just did that before reading your message. Thanks.
Should be ok now (hopefully).

Sorry for the trouble.


# Update data
for i in range(len(data)):
lines[i].set_ydata(i + G * data[i])
Copy link
Member

Choose a reason for hiding this comment

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

sorry, one last thing, update should return the artists changed. This is mostly to make blitting work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Which one (there are 256 of them) ?

Copy link
Member

Choose a reason for hiding this comment

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

The list of all of them (lines).

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@tacaswell tacaswell added this to the v1.4.0 milestone Jun 3, 2014
tacaswell added a commit that referenced this pull request Jun 4, 2014
New animation example (Joy Division's Unchained Love cover)
@tacaswell tacaswell merged commit e322d5f into matplotlib:master Jun 4, 2014
@rougier rougier deleted the unchained branch June 4, 2014 06:12
@AstroMike
Copy link

This demo is fantastic! ... the only problem is the name. I am not sure where "Unchained Love" comes from: the famous Joy Division album with the line art showing data from pulsar B1919+21 is called "Unknown Pleasures"

@rougier
Copy link
Member Author

rougier commented Jan 14, 2017

Thanks for the information. I don't remember where I get this name from actually.
Your reference to pulsar B1919+21 means the cover was showing actual data?

@AstroMike
Copy link

Yes, it's real data.

There have been several articles about the origins of this plot. For example:

https://blogs.scientificamerican.com/sa-visual/pop-culture-pulsar-origin-story-of-joy-division-s-unknown-pleasures-album-cover-video/

@rougier
Copy link
Member Author

rougier commented Jan 14, 2017

Fantastic ! Didn't know.

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.

None yet

5 participants