1 year ago

#386610

test-img

Abhinav Choudhury

Increase box plot size inside Violin plot in Seaborn

I was plotting data in a Grouped Violinplot as shown in the image.Seaborn Violin Plot Is there any way to increase the size (width) of the boxplots inside the violin plots in seaborn? As the boxplots are not even visible in the image attached. I am also adding the code I used to generate the plots.

sns.set_style('whitegrid', {'font.family':'serif', 'font.serif':'Times New Roman'})


sns.set(style='white',font_scale = 7.5)
sns.color_palette("Set2")

fig, ax = plt.subplots(figsize=(60, 30))

ax.spines['left'].set_linewidth(10)
ax.spines['bottom'].set_linewidth(10)
ax.spines['left'].set_color('black')
ax.spines['bottom'].set_color('black')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.set_xlabel('')
ax = sns.violinplot(x=df.M, y=df.C, hue=df.G,scale = 'area',palette=sns.color_palette('Set2', n_colors=5),aspect=50/50,box_visible = True)
ax.set_ylabel([], fontsize = 105)
ax.set_xlabel("", fontsize = 25)
plt.legend(loc="upper left", frameon=False, fontsize=85,ncol=2)

plt.show()

Please help.

Thank you in advance

seaborn

0 Answers

Your Answer

Accepted video resources