-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Passing an incorrectly sized colour list to scatter should raise a relevant error #9209
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
This is fixed in master. Should be fixed for 2.1 release. The error raised is
|
Closing - feel free to re-open if you think its not fixed in the upcoming 2.1. Thanks for the report! |
Fixed in #7363 |
I am getting this error |
@PorkShoulderHolder please change c to have a shape of (n,1) instead of (n,) - this works for me. |
@sabyagunnersya I try both (n,1) and (n,). Both of them are not working! Is there any other solution? Thanks! |
@PorkShoulderHolder @weihuaguo Is this the issue you were seeing? #15727 |
This works for me as well, but this does not seem like expected behaviour? There is no obvious reason (n,) should not work. |
LoL, I just got this:
|
@soerendip What version of Matplotlib? I think we have improved that error message recently. Do you have a minimal example that will produce that error? |
I got the same error: My version of Matplotlib is 3.1.3
I've fixed it though -- changed Y to Y.values.reshape(Y.shape[0]) |
If the length of the
c
argument tomatplotlib.pyplot.scatter
doesn't match the size of thex
andy
arguments, a confusing error message is raised:Invalid RGBA argument
. Contrast this with the error that results ifx
andy
are not the same size:x and y must be the same size
. The error message for an incorrect sizec
array should be made more clear.Code for reproduction
Actual outcome
Expected outcome
The text was updated successfully, but these errors were encountered: