so for the context. I build a small arduino based weather station and want to plot my data for some analysis. I store my measuments in a .json file and want to draw my diagram with these values.
def getVal():
data = db.all()
tempData = []
voltData = []
time = []
for i in range(len(data)-1):
tempData.append(data[i]['temperature'])
voltData.append(data[i]['volt'])
time.append(i)
print(voltData)
print(tempData)
plt.plot(time, tempData, 'b-')
plt.plot(time, voltData, 'r-')
plt.show()
Here are the values for voltData and tempData
['3.94', '3.38', '3.85', '3.89', '3.84', '3.95', '3.85', '3.85', '3.89', '3.77', '3.84', '3.68', '3.84', '3.85', '3.83', '3.30', '3.95', '3.91', '3.85', '3.87', '3.82', '3.82', '3.87', '3.91']
['15.30', '14.90', '14.90', '15.10', '15.00', '15.10', '15.00', '15.10', '14.80', '14.60', '14.70', '14.70', '14.50', '14.40', '14.20', '14.10', '13.90', '13.60', '13.20', '12.60', '12.10', '11.80', '11.50', '11.20']
Now i doent know what went wrong but here is my Output. Thanks for your help <3