GeezerVison is showing github.com — Fix `Collection.draw()` single-path optimization when edgecolor/facecolor is 'none' by ayshih · Pull Request #32232 · matplotlib/matplotlib
Conversation
ayshih
commented
Aug 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR summary
Fixes #17790. The immediate bug is that setting facecolor or edgecolor to "none" sets the color to an empty list, but the Collection.draw() logic to detect for single-path optimization does not consider an empty list to be a single color. That is, single-path optimization would never happen if facecolor or edgecolor is set to "none". This PR fixes that situation.
That said, this PR requires discussion because single-path optimization is newly triggered in 30+ figure tests, which means their baseline images need to be updated. This is because draw_markers() produces different output than draw_path_collection(). It's worth investigating whether single-path optimization is in fact appropriate in all cases before accepting this PR.
AI Disclosure
PR quality check
- Use an expressive title, e.g. "Fix title font property precedence"
- New and changed code is tested
- [N/A] Plotting related features are demonstrated in an example
- [N/A] New features and API changes have release notes
- [N/A] Documentation complies with general and docstring guidelines
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 19, 2026
That said, this PR requires discussion because single-path optimization is newly triggered in 30+ figure tests, which means their baseline images need to be updated. This is because draw_markers() produces different output than draw_path_collection(). It's worth investigating whether single-path optimization is in fact appropriate in all cases before accepting this PR.
- We could reduce the number of images affected by this PR by creating a way to disable single-path optimization where it is not appropriate given the collection type.
- We could review the (Agg) code for
draw_markers() and draw_path_collection() to see if there are any bugs that are contributing to the discrepancies between the rendered output.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
There's been a long standing bug with the single-path optimization #15946 Possibly #32108 may be relevant here, though I didn't test that specific case yet.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.