I have a pandas df as below and I have the following codes to plot in seaborn:
Group IP IB FP CP CS PB
0 1 100 20 50 120 40 90
1 1 100 20 50 120 40 80
2 1 100 20 50 120 40 78
3 1 100 20 50 120 40 70
4 1 100 20 50 120 40 62
... ... ... ... ... ... ... ...
95 18 150 40 50 150 60 50
96 19 200 20 70 150 40 72
97 19 200 20 70 150 40 64
98 19 200 20 70 150 40 74
99 19 200 20 70 150 40 76
df_m = pd.melt(df, id_vars='Group', value_vars=['PB'])
fig, ax = plt.subplots(figsize=(15,10))
sns.stripplot(x='variable', y='value', data=df_m, hue='Group', dodge=True, ax=ax, linewidth=1)
sns.boxplot(x='variable', y='value', data=df_m, hue='Group')
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles[:19], labels[:19], title='Group')
I can get the graph like this:

what I want to is to have the legends (groups 1-19) as the x axis ticks. I tried this but the graph becomes squeezed:
ax.set_xticks(range(19))
ax.set_xticklabels(['G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9', 'G10',
'G11', 'G12', 'G13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G19']);

