Created
January 15, 2020 19:57
-
-
Save Ze1598/2f3ab0fa80ae306772861bb786971633 to your computer and use it in GitHub Desktop.
Matplotlib intro: horizontal 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.barh(options, pairs_owned) | |
plt.title("Years of experience working with Python (n=40)") | |
plt.xlabel("Number of respondents") | |
plt.tight_layout() | |
plt.savefig("bar_hor_chart_demo.png") | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment