Violin plots not plotting over xticks in seaborn

17 Views Asked by At

I am plotting data in seaborn using a violin plot, and the plots are not centering over the xticks. If I strike the "hue" argument, they align, but everything looks bad, and I would like to keep the hues. Any advice?

Code:

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')

snippet of dataframe

output of plot

0

There are 0 best solutions below