Python Forum

Full Version: Plot several graphs on the same row
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
Here is a code that I use to plot multiple boxplots at the same time :

for year in [2016,2017,2018,2019,2020,2021] :
    plt.figure(figsize=(5,10))
    sns.boxplot(
        data=CR,
        x='Code_Sexe',
        y='PM_FIN_{}_ECR'.format(year),showfliers = False,showmeans=True)
Where Code_Sexe is binary (1,2) and PM_FIN_2016_ECR is a numeric variable.

Which gives me the output in attachment with 6 graphs on the same column. I would like to have instead, 3 columns and two rows, with 3 graphs on the same row.


Thank you by advance !

Mathis