21 lines
338 B
Python
21 lines
338 B
Python
|
import sqlite3
|
||
|
import matplotlib.pyplot as plt
|
||
|
import numpy as np
|
||
|
|
||
|
con = sqlite3.connect("data.db")
|
||
|
cur = con.cursor()
|
||
|
|
||
|
res = cur.execute("SELECT time, watts FROM data")
|
||
|
|
||
|
x_values = []
|
||
|
y_values = []
|
||
|
|
||
|
for time, watts in res:
|
||
|
x_values.append(time)
|
||
|
y_values.append(watts)
|
||
|
|
||
|
plt.plot(x_values, y_values)
|
||
|
|
||
|
plt.ylim([0, 200])
|
||
|
|
||
|
plt.show()
|