把seaborn的散点图画到同一行,并列一行


把seaborn的散点图画到同一行,并列一行

fig, (ax1, ax2, ax3) = plt.subplots(1,3,figsize=(10,8))

sns.boxplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='tfidf'], ax=ax1)
sns.swarmplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='tfidf'], color="0.25", ax=ax1)

sns.boxplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='lda'], ax=ax2)
sns.swarmplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='lda'], color="0.25", ax=ax2)

ax2.set_ylabel("")  # remove y label, but keep ticks

sns.boxplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='doc2vec'], ax=ax3)
sns.swarmplot(x="feedback", y="similarity_score", data=df[df.nlp_model=='doc2vec'], color="0.25", ax=ax3)

ax3.set_ylabel("")  # remove y label, but keep ticks

plt.show()