Skip to content

Instantly share code, notes, and snippets.

@arsho
Created September 20, 2016 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arsho/1f80b769bb970f90632c6ec11268499e to your computer and use it in GitHub Desktop.
Save arsho/1f80b769bb970f90632c6ec11268499e to your computer and use it in GitHub Desktop.
Basic bar chart using matplotlib
import matplotlib.pyplot as plt
year = [2000,2001,2002,2003]
popu = [1.00,1.50,2.00,2.50]
y_pos = range(len(year))
plt.bar(y_pos,popu,label='Population',color='g', align='center')
plt.xticks(y_pos, year)
plt.legend()
plt.xlabel('year')
plt.ylabel('population')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment