You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you set alpha = 1, collections::set_alpha() calls _set_facecolor(), which further calls to_rgba_array() in collections.py, Line 766: self._facecolors = mcolors.to_rgba_array(c, self._alpha) in which c is a list of strings: ["blue", "none"], and alpha is [1, 1].
Incolors::to_rgba_array(), Line 509 - 510, the alpha param is used to replace the default alpha values in the rgba sequence:
if alpha is not None:
rgba[:, 3] = alpha
resulting in the following change:
facecolor rgba before applying alpha
[[0. 0. 1. 1.] # this is blue
[0. 0. 0. 0.]] # this has no color
facecolor rgba after applying alpha
[[0. 0. 1. 1.] # this is still blue
[0. 0. 0. 1.]] # this becomes black
To produce the expected outcome, try the following code:
Bug summary
As title, using alpha parameter in PathCollection, either as a list or as a scalar value, causes 'none' facecolors to be ignored / filled
Code for reproduction
Actual outcome
Expected outcome
Additional information
No response
Operating system
Windows
Matplotlib Version
3.8.3
Matplotlib Backend
No response
Python version
3.12
Jupyter version
No response
Installation
pip
The text was updated successfully, but these errors were encountered: