nissan-leaf-reader/plotVoltages.py
2020-09-30 12:35:09 -07:00

24 lines
397 B
Python

import matplotlib.pyplot as plt
import time
def plotVoltages(vList):
if ~plt.fignum_exists(1):
print("true")
plt.ylabel("Voltage (V)")
plt.xlabel("Cell Number")
plt.bar(vList, [1,2,3,4])
plt.show()
else:
plt.clf()
plt.draw()
return
x = [1, 2, 3, 4]
plotVoltages(x)
time.sleep(3)
plt.clf()
x = [4,3,2,1]
vv = plotVoltages(x)