Skip to content

Instantly share code, notes, and snippets.

@dottyz
Created May 2, 2019 18:38
Show Gist options
  • Save dottyz/04a34a802e3b1b7693e3ba112bc32e12 to your computer and use it in GitHub Desktop.
Save dottyz/04a34a802e3b1b7693e3ba112bc32e12 to your computer and use it in GitHub Desktop.
fig, (ax1, ax2) = plt.subplots(2, 2, figsize=(15, 15))
for i, col in enumerate(['Duration', 'Distance']):
# Graph the distribution plots (seaborn doesn't allow default separation for distplot)
for j, user in enumerate(df['User Type'].unique()):
sns.distplot(df[df['User Type']==user][col], hist=False, ax=ax2[i])
# Graph the boxplots
sns.boxplot(x=col, y='User Type', data=df, ax=ax1[i])
ax1[i].set_xlabel('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment