Python 熊猫条形图

Python 熊猫条形图,python,python-3.x,pandas,matplotlib,Python,Python 3.x,Pandas,Matplotlib,我刚刚转到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=col

我刚刚转到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)
制作:

但现在图表显示:

因此,将拾取第一种颜色,但不会拾取其余颜色

不知道这是一个bug还是一种新的方法,尽管我找不到正确的参考。

将颜色作为列表传递:

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])

非常感谢您的快速回答。一个奇怪的变化。@TanguyBretagne是的,我正在寻找关于它的文档,对吗now@TanguyBretagne我想我找到了,这是熊猫的变化。从0.19.0的新功能