Skip to content

Instantly share code, notes, and snippets.

Created July 4, 2014 17:21
Embed
What would you like to do?
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