FIX: scatter with ls="" crashes on PDF savefig#31587
FIX: scatter with ls="" crashes on PDF savefig#31587beelauuu wants to merge 4 commits intomatplotlib:mainfrom
Conversation
dstansby
left a comment
There was a problem hiding this comment.
Thanks, this looks good, and I manually checked it fixes the original issue 👍
I have one question about the test before approving.
Refactor test_scatter_empty_linestyle to use 'pdf' backend only.
|
Since the bug is in the line collection object, it would make sense to test
the _get_dash_pattern() method to make sure it works as expected. The pdf
test is useful as an integration test, but the test doesn't explain what
exactly it is testing for and why only those parameter values. Do we know
that only pdf is affected? What about eps?
…On Wed, Apr 29, 2026 at 3:23 PM David Stansby ***@***.***> wrote:
***@***.**** approved this pull request.
—
Reply to this email directly, view it on GitHub
<#31587 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6ACUZCZVEOCFCW542T4YJJDZAVCNFSM6AAAAACYK4IKFKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DEMBQGA2TSMBVGE>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I can add a unit test for the I verified that the SVG, PS/EPS, and AGG backends don't crash (and had them in the unit test at first; happy to add them back if you feel like it's needed). They skip setting the linewidth on the graphics context because the empty linestyle list causes Let me know your thoughts @WeatherGod |
PR summary
Closes #31585
Fixes a crash when saving a figure containing a scatter plot with
ls=""(orls=" "/ls="none") to a PDF file.""," ", and"none"are documented "draw nothing" linestyle aliases, but_get_dash_patterninlines.pydid not recognize them —it only handled
"solid"and"None"AI Disclosure
This PR was developed with Claude Code for triaging. The root cause analysis, fix location, and test coverage were worked out together.
PR checklist
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
https://matplotlib.org/devdocs/devel/api_changes.html#announce-changes-deprecations-and-new-features
https://matplotlib.org/devdocs/devel/document.html#write-docstrings guidelines