📜  python seaborn violin stackoverflow - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:10.885000             🧑  作者: Mango

代码示例1
import matplotlib.pyplot as plt
import seaborn as sns

x = ["G","F","E","D","C","B"]
y = [3,14,45,47,34,15]

data = []
for i, yi in enumerate(y):
    data.extend([i]*yi)

sns.violinplot(y=data)
plt.yticks(range(len(x)), x)
plt.show()