Last active
October 15, 2019 13:40
-
-
Save cereniyim/90bc4e7114a1899d2b6fed6f817a496b to your computer and use it in GitHub Desktop.
Histogram with 5 bins
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
# set the plot | |
plt.hist(df.life_expectancy, | |
range=(df.life_expectancy.min(), df.life_expectancy.max()+1), | |
bins=5, | |
alpha=0.5) | |
# set title, legends and labels and xticks | |
plt.xlabel("Life Expectancy") | |
plt.ylabel("Count") | |
plt.title("Histogram of Life Expectancy between 1952 and 2007 in the World") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment