Last active
October 25, 2023 00:58
-
-
Save WillKoehrsen/09e8527a5b95682a68ff4eebe1a9e8bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show 4 different binwidths | |
for i, binwidth in enumerate([1, 5, 10, 15]): | |
# Set up the plot | |
ax = plt.subplot(2, 2, i + 1) | |
# Draw the plot | |
ax.hist(flights['arr_delay'], bins = int(180/binwidth), | |
color = 'blue', edgecolor = 'black') | |
# Title and labels | |
ax.set_title('Histogram with Binwidth = %d' % binwidth, size = 30) | |
ax.set_xlabel('Delay (min)', size = 22) | |
ax.set_ylabel('Flights', size= 22) | |
plt.tight_layout() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment