[Python3]如何使用seaborn/matplotlib绘制55列

[Python3]如何使用seaborn/matplotlib绘制55列,python,matplotlib,seaborn,Python,Matplotlib,Seaborn,提前谢谢 我想知道如何使用Seaborn+Matplotlib组合来制作漂亮的条形图。 以下是我拥有的示例数据集: 2015-01 2015-02 2015-03 2015-04 2015-05 negative 28 13 12 33 7 positive 78 20 19 3 55 neutral 17 5 45 24 9 我想

提前谢谢

我想知道如何使用Seaborn+Matplotlib组合来制作漂亮的条形图。 以下是我拥有的示例数据集:

         2015-01 2015-02 2015-03 2015-04 2015-05
negative   28      13       12     33      7  
positive   78      20       19     3       55  
neutral    17      5        45     24      9

我想让条形图看起来像这样,这是我用excel创建的图表,但我想知道如何使用python做同样的事情?或者类似的事情?

如果您的数据帧是熊猫数据帧,您可以执行以下操作:

df.T.plot.bar(width=0.8, edgecolor='w', linewidth=3)
这给了你:


可以通过以下方式实现:

import pandas as pd
import io
import seaborn as sns
import matplotlib.pyplot as plt
资料

海本

sns.set_theme(style="whitegrid")
tips = sns.load_dataset("tips")
ax = sns.barplot(x="Date", hue="Emotion", y="Count", data=ndf)

快速的谷歌搜索可以为您找到许多解决方案。请尝试此链接@这对你有帮助吗?谢谢!!!Ruthger@Elainayg字体很高兴能帮助你!如果你愿意,你可以投票/接受答案。
sns.set_theme(style="whitegrid")
tips = sns.load_dataset("tips")
ax = sns.barplot(x="Date", hue="Emotion", y="Count", data=ndf)