I've created a horizontal violin plot and would like to have a vertical line as a marker for x = 0, because it will help to make very clear where "Change" (i.e. x) is negative or positive. I have toyed with some attempts to use plt.axvline(0,color='k'), but it doesn't work and seems to create outputs of empty plots.

sns.violinplot(ax=ax, x="Change", y="Time", data=df, inner="quartile", cut=0, palette="Set2").set_title('Change in food price over different time periods')

0 Answers