blob: 5ba8ccfebd2ce199179e559326d2c583db68255e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import matplotlib.pyplot as plt
import numpy as np
# Open and read the file
with open(".power_log", "r", encoding="utf-8") as f:
data = f.readlines()
# Extract numerical values from each line
measurements = [float(line.strip()) for line in data]
# Generate time values (assuming measurements are taken every second)
time_values = np.arange(len(measurements))
# Plot the data
plt.figure(figsize=(10, 6))
plt.plot(time_values, measurements, marker='o', linestyle='-')
plt.title('Power Measurements Over Time')
plt.xlabel('Time (seconds)')
plt.ylabel('Power Measurement')
plt.grid(True)
plt.show()
|