3

If s is a Series, I get an error message when I run the following command :

s.plot(style='k--', color='b')

The error message says that [b] is not a recognized color.

I am using pandas 0.11 .

Do you have the same problem ?

1 Answer 1

5

Your code is asking style to be 'k' (black) and '--' (dashed) but passing the additional color 'b' (blue), so matplotlib throws an exception (at having two colors).

To render a blue dashed line you can either do:

s.plot(style='b--')
s.plot(style='--', color='b')
Sign up to request clarification or add additional context in comments.

1 Comment

If I want to add points in my graph with the style 'o--', only the first works : s.plot(style='bo--')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.