熊猫条形图

Tan*_*gne 3 python matplotlib python-3.x pandas

我刚刚搬到了pandas 0.20/matplotlib 2.0 python 3.6.(总共形成以下版本).我用pandas绘制条形图,因为matplotlib总是太低了.着色列的行为现在已经改变,我不知道如何解决这个问题.它曾经是以下:

np.random.seed(42)
d = pd.Series(data=np.random.rand(10), index=range(10))
color=np.random.rand(10,4)

d.plot.bar(color=color)
Run Code Online (Sandbox Code Playgroud)

生产:

旧版

但现在图表产生:

新版本

因此,第一种颜色被拾取,而不是其余颜色.

想知道这是一个错误还是一种新的方法,虽然我找不到正确的参考.

Sco*_*ton 5

将颜色作为列表传递:

np.random.seed(42)
d = pd.Series(data=np.random.rand(10), index=range(10))
color=np.random.rand(10,4)

d.plot.bar(color=[color])
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述