-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Modified scatter method to correctly recognize RGB/A values #6087
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
Conversation
DOC: linestyle is dash_dot and should be dashdot
Correct link to favicon
@@ -3861,7 +3861,7 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None, | |||
# favor of mapping, not rgb or rgba. | |||
try: | |||
c_array = np.asanyarray(c, dtype=float) | |||
if c_array.size == x.size: | |||
if c_array.size == x.size and c_array.shape[0] != 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anyway we can get a numpy-scaler in here as a valid input? If so probably want to be a bit more paranoid and add and carray.ndims
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and would the check on c_array.ndim == 1
be a better check?
Added images and links for seaborn, holoviews, and ggplot
Fix matplotlib#6069. Handle image masks correctly
This appears to be a backporting error. Closes matplotlib#6120
TST: pull test image from master branch
Yes, I think you are right. I hadn't noticed the existence of ndim previously. |
Can you please rebase onto current master (or at least current v2.x)? Merging upstream branches into feature branches causes problems, please do not do it. |
Closing this. There doesn't seem to be a good way to resolve this ambiguity, and it's already been discussed and notated in the comment in the code where this change is. |
This is a fix for #5377.
After being converted to a ndarray, the scatter method does not check if c_array is a 2D array (i.e. if we are passing RGB or RGB/A values.