Files
hpos-data/scripts/battery_plot.py

15 lines
508 B
Python
Raw Normal View History

2023-12-08 21:52:10 +05:30
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()