plot battery levels

This commit is contained in:
Pritimay Sarkar
2023-12-08 21:52:10 +05:30
parent 14a0d5bc0f
commit 2ab4d7c3cd

14
scripts/battery_plot.py Normal file
View File

@@ -0,0 +1,14 @@
import matplotlib.pyplot as plt
# Given data
battery_level = [89.0, 89.0, 89.0, 89.0, 89.0, 89.0, 90.0, 90.0, 90.0, 83.0, 86.0, 45.0, 45.0]
battery_voltage = [4.145, 4.145, 4.145, 4.145, 4.145, 4.145, 4.145, 4.133, 4.133, 4.029, 4.107, 3.736, 3.732]
# Plotting
plt.figure(figsize=(10, 6))
plt.plot(battery_level, battery_voltage, marker='o', linestyle='-', color='b')
plt.title('Battery Level vs Battery Voltage')
plt.xlabel('Battery Level (%)')
plt.ylabel('Battery Voltage (V)')
plt.grid(True)
plt.show()