Seaborn中的小提琴图未在xticks上绘制
我在使用seaborn绘制小提琴图的时候,发现图形没有对齐到x轴的刻度上。如果我去掉“hue”这个参数,图形就能对齐了,但这样看起来效果不好,我想保留颜色的区分。有没有什么建议?
代码:
fig, ax = plt.subplots()
sns.violinplot(violin_data, y = 'Height', x = 'Sample', ax= ax, hue= 'scalloped')
plt.xticks(rotation = 45)
ax.set_xlabel('')
ax.set_ylabel('Intermediate Length ($\mu$m)')
plt.legend(title = '')
ax.set_yscale('log')
0 个回答
暂无回答