Created
January 15, 2020 19:55
-
-
Save Ze1598/0a22aed111425d31d041b2a29633baa5 to your computer and use it in GitHub Desktop.
Matplotlib intro: bar chart
This file contains hidden or 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
| from matplotlib import pyplot as plt | |
| pairs_owned = [16, 9, 9, 6] | |
| options = ["One", "Two", "Three", "Four+"] | |
| plt.bar(options, pairs_owned) | |
| plt.title("Years of experience working with Python (n=40)") | |
| plt.ylabel("Number of respondents") | |
| plt.tight_layout() | |
| plt.savefig("bar_chart_demo.png") | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment