Skip to content

Add warning for multiple pyplot.figure calls with same ID #27992

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 5 commits into from
May 19, 2024

Conversation

Impaler343
Copy link
Contributor

@Impaler343 Impaler343 commented Mar 29, 2024

PR summary

Closes #27978. This hopefully adds the relevant warning discussed in the issue

PR checklist

@tacaswell tacaswell added this to the v3.10.0 milestone May 10, 2024
@tacaswell
Copy link
Member

It looks like appveyor failed trying to install the codecov uploader.

@tacaswell
Copy link
Member

The test failures looked unrelated, re-running.

@Impaler343 Impaler343 force-pushed the figure-warning branch 2 times, most recently from c8e7a8e to f36cdcf Compare May 19, 2024 09:34
@github-actions github-actions bot added Documentation: plot types files in galleries/plot_types Documentation: devdocs files in doc/devel labels May 19, 2024
@github-actions github-actions bot removed Documentation: plot types files in galleries/plot_types Documentation: devdocs files in doc/devel labels May 19, 2024
else:
num = int(num) # crude validation of num argument
if any([figsize, dpi, facecolor, edgecolor, not frameon,
kwargs]) and num in allnums:
Copy link
Member

Choose a reason for hiding this comment

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

Reading this one more time, I think we also need the warning around line 988 for the case were someone does:

fig = plt.figure()
plt.figure(fig, figsize=(2, 2))  # this should warn as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, added that as well

@timhoffm
Copy link
Member

Failing tests are unrelated.

@timhoffm timhoffm merged commit f3359a3 into matplotlib:main May 19, 2024
39 of 42 checks passed
@Impaler343 Impaler343 deleted the figure-warning branch August 8, 2024 17:58
@Impaler343 Impaler343 restored the figure-warning branch August 8, 2024 17:59
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.

[Bug]: strange behaviour when redefining figure size
3 participants