繪制小提琴圖
import seaborn as sns import matplotlib.pyplot as plt # 創(chuàng)建數(shù)據(jù) data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # 生成小提琴圖 sns.violinplot(data) # 顯示圖形 plt.show()
python3.8,繪制結(jié)果如下圖所示: