Skip to content

Conversation

@cairibep
Copy link

PR Summary

Fix the bug described in #24404, in which the scatter function did not respect the facecolors='none' option, resulting in filled markers even when the user only wanted an outline. Since there are logs reporting the possibility that the c parameter in scatter() might fail to override facecolor, this implementation accounts for this possibility.

Why is this change necessary?

The facecolors='none' option should produce hollow (unfilled) markers, but the current behavior ignored this setting, filling the markers with the default color.

What problem does it solve? Allows plt.scatter(..., facecolors='none') to correctly draw empty markers—that is, with only the outline visible, as expected and as per the documentation.

What is the reason for this implementation?

The implementation adjusts the internal handling of facecolors in PathCollection, ensuring that the value none is interpreted correctly and the fill is omitted.

Minimal Example

from matplotlib.pylab import *
x = arange(0, 10)
scatter(x, x, c=x, facecolors='none')
show()

Old output:
image

Result with modification:
saida

Operating system

windows

Matplotlib Version

latest

Python version

3.11

@QuLogic
Copy link
Member

QuLogic commented Oct 23, 2025

There are linting errors, but more importantly, it appears you've removed very large chunks of existing support, which breaks the tests, and would not be wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants