Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import matplotlib as mpl
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.dates as mdates
- import datetime as dt
- dates = [] #create empty data set
- with open('/media/Library/size_history.csv','r') as f:
- for line in f:
- dates.append(line.split(',')[0])
- x = [dt.datetime.strptime(d,'%Y/%m/%d').date() for d in dates]
- y = np.genfromtxt('/media/Library/size_history.csv', delimiter=',', usecols=(1))
- plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d'))
- plt.gca().xaxis.set_major_locator(mdates.WeekdayLocator(byweekday=6,interval=1,tz=None))
- plt.gca().set_ylim(top=10870) #size of NAS in GB
- plt.gca().set_ylim(bottom=8000) #lowest capacity on record
- plt.plot(x,y)
- plt.title('Storage Use Trend')
- plt.ylabel('Storage Used(GB)')
- plt.xlabel('Date')
- plt.gcf().autofmt_xdate()
- plt.grid(True,color='k')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement