Fix SVG rendering error in def update_background#30490
Merged
tacaswell merged 4 commits intomatplotlib:mainfrom Sep 2, 2025
Merged
Fix SVG rendering error in def update_background#30490tacaswell merged 4 commits intomatplotlib:mainfrom
tacaswell merged 4 commits intomatplotlib:mainfrom
Conversation
Contributor
Author
|
i tested the fix using the code below which reproduces the issue and confirms that SVG export no longer crashes: |
fd2cfb4 to
3d6e31c
Compare
3d6e31c to
a7e81ef
Compare
dc45b51 to
a1caf12
Compare
Member
|
There is no such thing as |
Contributor
Author
|
I have updated the PR with the issue number and more accurate files and functions to navigate the issue as well as the fix. Hope this makes it easier to navigate and review! |
timhoffm
reviewed
Aug 31, 2025
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
timhoffm
reviewed
Aug 31, 2025
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
timhoffm
reviewed
Sep 1, 2025
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
timhoffm
approved these changes
Sep 1, 2025
tacaswell
approved these changes
Sep 2, 2025
Member
tacaswell
left a comment
There was a problem hiding this comment.
@AasmaGupta Do you feel comfortable squashing this to one commit? IF not we can squash-merge.
Otherwise 👍
Contributor
Author
|
@tacaswell I'm fine with you squash merging it from your end. Thanks! |
13 tasks
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Sep 2, 2025
timhoffm
added a commit
that referenced
this pull request
Sep 2, 2025
…490-on-v3.10.x Backport PR #30490 on branch v3.10.x (Fix SVG rendering error in def update_background)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference issue (if any)
Example: AttributeError: 'FigureCanvasSVG' object has no attribute 'copy_from_bbox'
Fixes #30485
Why is this change necessary?
Saving figures as SVG could crash due to the way
def update_backgroundhandled blitting in thelib/matplotlib/widgets.pyfile. This change prevents that crash.What problem does it solve?
fixes the crash that occurred specifically when exporting plots to SVG format
What is the reasoning for this implementation?
Blitting is meant for interactive updates and isn’t needed when saving static outputs. Skipping it during SVG export prevents the crash while keeping normal interactive behavior intact.
PR checklist