| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
i tested the fix using the code below which reproduces the issue and confirms that SVG export no longer crashes: import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.widgets import SpanSelector
fig, ax = plt.subplots()
ax.plot(np.random.randn(100, 3))
ax._span = SpanSelector(ax, lambda xmin, xmax: None, "horizontal", useblit=True)
fig.savefig("test.svg")
print("Saved successfully without crash!")
|
Sorry, something went wrong.
|
There is no such thing as _setup_plot_projector in Matplotlib; what is this actually about? |
Sorry, something went wrong.
|
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! |
Sorry, something went wrong.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
There was a problem hiding this comment.
@AasmaGupta Do you feel comfortable squashing this to one commit? IF not we can squash-merge.
Otherwise 👍
Sorry, something went wrong.
|
@tacaswell I'm fine with you squash merging it from your end. Thanks! |
Sorry, something went wrong.
…490-on-v3.10.x Backport PR #30490 on branch v3.10.x (Fix SVG rendering error in def update_background)
| Back | FazBrowse Home | New Git URL |
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 the lib/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