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 ?

Zeugma
  • 31,231
  • 9
  • 69
  • 81
Maxi
  • 547
  • 1
  • 7
  • 18

1 Answers1

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')
Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
  • If I want to add points in my graph with the style 'o--', only the first works : s.plot(style='bo--') – Maxi Jul 30 '13 at 14:47