Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的数据集:
我想使用 seaborn 来绘制每一列,就像pandas默认情况下一样:
pandas
有什么线索吗?提前致谢
您可以先将数据堆叠起来,然后再sns.barplot配合hue使用:
sns.barplot
stacks = df.stack().reset_index() plt.figure(figsize=(10,10)) sns.barplot(x='level_1', y=0, data=stacks, hue='cat') plt.show()
输出: