Skip to content

Instantly share code, notes, and snippets.

@Ze1598
Created January 15, 2020 19:55
Show Gist options
  • Save Ze1598/0a22aed111425d31d041b2a29633baa5 to your computer and use it in GitHub Desktop.
Save Ze1598/0a22aed111425d31d041b2a29633baa5 to your computer and use it in GitHub Desktop.
Matplotlib intro: bar chart
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