comparison graph.py @ 12:2b115732f4bc

Fix graph saving
author Daniel O'Connor <darius@dons.net.au>
date Fri, 22 Dec 2017 13:19:52 +0100
parents e1bec6dfd524
children 3f22fa1f32d5
comparison
equal deleted inserted replaced
11:e1bec6dfd524 12:2b115732f4bc
243 fig.subplots_adjust(left = 0.10, right = 0.88, top = 0.95, bottom = 0.15) 243 fig.subplots_adjust(left = 0.10, right = 0.88, top = 0.95, bottom = 0.15)
244 if fname == None: 244 if fname == None:
245 matplotlib.pyplot.show() 245 matplotlib.pyplot.show()
246 else: 246 else:
247 canvas = matplotlib.backends.backend_agg.FigureCanvasAgg(fig) # Sets canvas in fig too 247 canvas = matplotlib.backends.backend_agg.FigureCanvasAgg(fig) # Sets canvas in fig too
248 fig.savefig(startlt.strftime(fname)) 248 fig.savefig(startdt.strftime(fname))
249 249
250 def updatedb(cur, data): 250 def updatedb(cur, data):
251 mkdb(cur) 251 mkdb(cur)
252 for d in data['reads']['data']: 252 for d in data['reads']['data']:
253 ts = datetime.datetime.strptime(d['t_stamp'], '%Y-%m-%dT%H:%M:%SZ') 253 ts = datetime.datetime.strptime(d['t_stamp'], '%Y-%m-%dT%H:%M:%SZ')