Skip to content

Instantly share code, notes, and snippets.

Created July 4, 2014 17:21
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 anonymous/6cae6d6d0ff7e205ed4a to your computer and use it in GitHub Desktop.
Save anonymous/6cae6d6d0ff7e205ed4a to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
plt.ion()
file_open = open('comicsSold.txt', 'r')
file_read = file_open.read()
years = []
sold = []
file_split = file_read.splitlines()
for line in file_split:
year = line.split(',')[0]
num = line.split(',')[1]
years.append(year)
sold.append(num)
first_year = years[0]
last_year = years[-1]
x = range(int(first_year), int(last_year)+1)
plt.plot(x, sold)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment