-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix SVG rendering error in def update_background #30490
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
Conversation
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
There is no such thing as |
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! |
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Tim Hoffmann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AasmaGupta Do you feel comfortable squashing this to one commit? IF not we can squash-merge.
Otherwise 👍
@tacaswell I'm fine with you squash merging it from your end. Thanks! |
…490-on-v3.10.x Backport PR #30490 on branch v3.10.x (Fix SVG rendering error in def update_background)
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_background
handled blitting in thelib/matplotlib/widgets.py
file. 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