Reputation: 25
I want to combine two graphs into one graph. I think it is quite simple but I could not figure it out. haha..
sns.countplot(x=low_tenure.Partner)
sns.countplot(x=high_tenure.Partner)
so I could compare two graphs
Thank you for helping me :)
Upvotes: 0
Views: 593
Reputation: 338
You could use common axis.
fig = plt.figure()
ax = fig.add_subplot(111)
sns.countplot(data1, ax=ax)
sns.countplot(data2, ax=ax)
Upvotes: 2
Reputation: 292
If you want to plot them altogether using seaborn
, you'd better combine two DataFrames first.
low_tenure['cat'] = 'Low tenure'
high_tenure['cat'] = 'High tenure'
df_combined = pd.concat([low_tenure, high_tenure])
sns.countplot(x='Partner', hue='cat', data=df_combined)
Upvotes: 1