Skip to content

Scatter doesn't accept a list of strings as color spec. #12438

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

Closed
jklymak opened this issue Oct 8, 2018 · 2 comments · Fixed by #12431
Closed

Scatter doesn't accept a list of strings as color spec. #12438

jklymak opened this issue Oct 8, 2018 · 2 comments · Fixed by #12431

Comments

@jklymak
Copy link
Member

jklymak commented Oct 8, 2018

Originally posted by @ImportanceOfBeingErnest in #12431 (comment)

I wonder if this is the correct fix. The documentation also states

c : color, sequence, or sequence of color, optional, default: 'b'
The marker color. Possible values:

  • A single color format string.
  • A sequence of color specifications of length n.

So for

plt.scatter([0,1],[2,3],c=("0.5", "0.7"))

one would expect two points with different shades of grey. But this is converted to an array of values and shown with the viridis colormap.
Not sure if the documentation is wrong here or the code.

@anntzer
Copy link
Contributor

anntzer commented Oct 8, 2018

Given that plt.scatter([0,1],[2,3],c=("r", "b")) works as expected and that "0.5", "0.7" are well-documented as strings meaning levels of gray, I'd argue it's a code bug, not a documentation one.

@jklymak
Copy link
Member Author

jklymak commented Oct 8, 2018

#12431 looks after this as well...

@QuLogic QuLogic added this to the v3.0.x milestone Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants