-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Scatter produce multiple colors for a single RGB/RGBA input #17423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IMO this is a pretty serious regression; it makes seaborn plots wrong with no straightforward way for the user to work around it. Could it please get a release critical tag? |
If you know ahead of time that you want to specify an RGG(A) color not values to be colormapped you can use the See #17499 for fix. |
|
We currently have that code in mpl and it is rather messy (which is why it keeps breaking :/ ) |
Bug report
Bug summary
Scatter docs say that in order to provide a single RGB/RGBA color for all scatter elements, it is required to pass a 2D array with a single row for
c
argument input:When x/y shape is 3 and RGB is passed as a 2D array with a single row (e.g.
c=[[1, 0.5, 0.05]]
), or when x/y shape is 4 and RGBA is passed as a 2D array with a single row, the plot elements have several different colors (taken from the default colormap?) while all should have the same color. The problem occurs for bothplt.scatter
andax.scatter
calls, and also ifc
input is provided as a numpy array of shape (1,3) for RGB or (1,4) for RGBA instead of a nested list.Code for reproduction
Actual outcome

Expected outcome
All points have the same color: RGB (1, 0.5, 0.05).
Matplotlib version
print(matplotlib.get_backend())
): aggMatplotlib installed through pip
The text was updated successfully, but these errors were encountered: