Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
VIS: plot method cannot handle new 'C0'-like colors (matplotlib 2.0) #15516
Comments
jorisvandenbossche
added the
Visualization
label
Feb 27, 2017
jorisvandenbossche
added this to the
Next Major Release
milestone
Feb 27, 2017
|
This one is pretty old, but I'd love to revive it. I'm not sure how tests will cover this change. Is it alright if I give it a try anyway? |
|
sure! try adding. test with the code as above (u will check this plot works) |
GuessWhoSamFoo
referenced
this issue
Apr 3, 2017
Merged
VIS: Allow 'C0'-like plotting for plotting colors #15516 #15873
TomAugspurger
closed this
in #15873
Apr 12, 2017
TomAugspurger
added a commit
that referenced
this issue
Apr 12, 2017
|
|
GuessWhoSamFoo + TomAugspurger |
7b8a6b1
|
linebp
added a commit
to linebp/pandas
that referenced
this issue
Apr 17, 2017
|
|
GuessWhoSamFoo + linebp |
b305120
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jorisvandenbossche commentedFeb 27, 2017
matplotlib 2.0 introduced a few 2-character color abbreviations: C0, C1, C2, ... to refer to the colors of the current color cycle
(very handy! this way you can refer to a color of the color cycle without hardcoding it, and use it as a shortcut for
color='tab:blue'if you want the new blue instead of the uglycolor='b')But, it seems pandas cannot handle this at the moment, as it tries to interpret it as multiple colors:
gives
ValueError: 'C0' can be parsed as both single color and color cycle. Specify each color using a list like ['C0'] or ['C', '0']I know the error message already gives the solution (using
color=['C0']), but I think it would be nice to special case those to have to working by default.