summaryrefslogtreecommitdiff
path: root/physics/plots/plot_errors.py
blob: 263248967b1f4ca6c6f226d710e43c4fa6603651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
import matplotlib.pyplot as plt
import numpy as np

# Read the errors from the file

fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot()

for filename in sys.argv[1:]:
    print(filename)
    try:
        data = np.loadtxt(filename)
        ax.plot(range(0, len(data[0])), data[0], data[1], label=f"{filename}")
    except Exception as e:
        print(f"Error loading {filename}: {e}")
    continue


ax.set_xlabel("Time")
ax.set_ylabel("Y")
# ax.set_zlabel("Z")
ax.legend()
ax.grid(True)
plt.show()