Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created March 23, 2018 16:24
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/e17f446a0cbe42ff337437e81dcd51ab to your computer and use it in GitHub Desktop.
Save WillKoehrsen/e17f446a0cbe42ff337437e81dcd51ab to your computer and use it in GitHub Desktop.
# Import the libraries
import matplotlib.pyplot as plt
import seaborn as sns
# matplotlib histogram
plt.hist(flights['arr_delay'], color = 'blue', edgecolor = 'black',
bins = int(180/5))
# seaborn histogram
sns.distplot(flights['arr_delay'], hist=True, kde=False,
bins=int(180/5), color = 'blue',
hist_kws={'edgecolor':'black'})
# Add labels
plt.title('Histogram of Arrival Delays')
plt.xlabel('Delay (min)')
plt.ylabel('Flights')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment