Why are colors not working in matplotlib for this example?

Viewed 1886

Why am I not seeing any red colors for the negative values here?

df = pd.DataFrame([1, -2, 3, -4])
df['positive'] = df[[0]]>0
df[[0]].plot(kind='bar', color=df.positive.map({True: 'g', False: 'r'}))

enter image description here

I am expecting negative values to be red!

As per our discussion below, this is a bug in the latest version of pandas 0.20.2.

1 Answers
Related