1

I use the following code to visualize different Seaborn plot in one windows:

fig, axs = plt.subplots(2,2, figsize=(6,6))
x1 = sns.jointplot(x="MO2: Vit. vent 1 10min  [m/s] ", y="MO2: Puissance active 10min  [kW] ", data=df_MO1_MO2.loc[df_MO1_MO2["Year"] == 2011], kind='kde', ax=axs[0][0])
x2 = sns.jointplot(x="MO2: Vit. vent 1 10min  [m/s] ", y="MO2: Puissance active 10min  [kW] ", data=df_MO1_MO2.loc[df_MO1_MO2["Year"] == 2012], kind='kde', ax=axs[0][1])
x2 = sns.jointplot(x="MO2: Vit. vent 1 10min  [m/s] ", y="MO2: Puissance active 10min  [kW] ", data=df_MO1_MO2.loc[df_MO1_MO2["Year"] == 2016], kind='kde', ax=axs[1][0])
x3 = sns.jointplot(x="MO2: Vit. vent 1 10min  [m/s] ", y="MO2: Puissance active 10min  [kW] ", data=df_MO1_MO2.loc[df_MO1_MO2["Year"] == 2017], kind='kde', ax=axs[1][1])
fig.suptitle('Active power evolution', position=(.5,1.1), fontsize=20)
fig.tight_layout()

This code return correctly a 2 by 2 subplot but it shows also the four plots in 4 different lines. Can you help me to find the error in my code.

Mabrouk
  • 83
  • 4
  • jointplot does not take an `ax` argument. So if this works at all it's by coincidence. Check [this question](https://stackoverflow.com/questions/35042255/how-to-plot-multiple-seaborn-jointplot-in-subplot) and links therein. – ImportanceOfBeingErnest Aug 08 '19 at 18:51
  • Did you figure out a way to do this? – a06e Nov 14 '21 at 18:11

0 Answers0