8000 No clf() needed after creating a figure by timhoffm · Pull Request #11998 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

No clf() needed after creating a figure #11998

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 1 commit into from
Sep 2, 2018

Conversation

timhoffm
Copy link
Member
@timhoffm timhoffm commented Sep 2, 2018

PR Summary

AFAIK fig.clf() does nothing on a freshly created figure. So clearing a freshly created figure is bad style and we shouldn't do it.

@timhoffm timhoffm added this to the v3.1 milestone Sep 2, 2018
@anntzer
Copy link
Contributor
anntzer commented Sep 2, 2018

Well technically plt.figure() could be re-raising a previously created figure, but I hope we don't ever do that in the gallery...

@timhoffm
Copy link
Member Author
timhoffm commented Sep 2, 2018

I think so. This should become more clear after #11999 and #12001 because the figure calls are then modified not to contain explicit figure numbers and thus cannot be reused.

Will rebase after #12001 is merged.

8000
Copy link
Member
@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@jklymak jklymak merged commit 891515e into matplotlib:master Sep 2, 2018
@timhoffm timhoffm deleted the no-clf-after-figure branch September 2, 2018 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0