summaryrefslogtreecommitdiff
path: root/physics/plots/plot_errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'physics/plots/plot_errors.py')
-rw-r--r--physics/plots/plot_errors.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/physics/plots/plot_errors.py b/physics/plots/plot_errors.py
new file mode 100644
index 0000000..2632489
--- /dev/null
+++ b/physics/plots/plot_errors.py
@@ -0,0 +1,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()