Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created March 23, 2018 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillKoehrsen/1efccfe7bef58a7a32d3501a68d5b850 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/1efccfe7bef58a7a32d3501a68d5b850 to your computer and use it in GitHub Desktop.
# Subset to Alaska Airlines
subset = flights[flights['name'] == 'Alaska Airlines Inc.']
# Density Plot with Rug Plot
sns.distplot(subset['arr_delay'], hist = False, kde = True, rug = True,
color = 'darkblue',
kde_kws={'linewidth': 3},
rug_kws={'color': 'black'})
# Plot formatting
plt.title('Density Plot with Rug Plot for Alaska Airlines')
plt.xlabel('Delay (min)')
plt.ylabel('Density')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment