Last active
July 26, 2017 11:23
-
-
Save sizhky/e96c260e1d35a0e51f0f629c25177c3f to your computer and use it in GitHub Desktop.
Matplotlib simple charts
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
######################################## | |
'''Simple Bar Chart''' | |
x_axis=['a','b','c'] | |
y_axis=[10,12,11] | |
fig, ax = plt.subplots(figsize=(20, 8)) | |
ax.set_xticks(range(len(x_axis))) | |
ax.bar(range(len(x_axis)), y_axis, align='center') | |
ax.set_xticklabels(x_axis, rotation='vertical') | |
######################################## | |
'''Simple Histogram''' | |
fig, ax = plt.subplots(figsize=(20, 6)) | |
ax.set_xticks(range(50)) | |
ax.hist(uinfo.Age, bins=50, range=(5,55)) | |
######################################## | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment