我有多个不同大小的数据集,我想从中绘制小提琴图。我的数据集如下所示:
Input.CSV:
city_A city_B city C city_D
cluster1 2 5 4 4
cluster2 3 3 2 8
cluster3 2 4 5 5
cluster4 3 5 4
cluster5 3 3
cluster6 5
注:每个城市都有不同的规模和数量的集群。在
我查阅了一些文章,如here,我不明白如何在一个图中绘制此数据集,如:
seaborn或matplotlib中的一些示例包含伪数据,而我的数据是CSV格式的,如我上面所示。如果你能在使用像我这样的数据的代码方面提供帮助,那就太好了。在
如果要绘制多个列表,可以将它们作为列表列表并打印。您可以在这里阅读文档https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.violinplot.html
Seaborn看起来是一个更好、更美观的数据帧解决方案。在
^{pr2}$相关问题 更多 >
编程相关推荐