-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotter.py
More file actions
28 lines (23 loc) · 780 Bytes
/
plotter.py
File metadata and controls
28 lines (23 loc) · 780 Bytes
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
26
27
28
import matplotlib.pyplot as plt
class Plotter:
def __init__(self):
pass
@staticmethod
def plot_states(pos, d_pos, dd_pos, angle, d_angle, dd_angle, time, name="Plot"):
fig, axs = plt.subplots(3, 2)
fig.suptitle(name, fontsize=14)
axs[0, 0].plot(time, pos)
axs[0, 0].set_title("x")
axs[1, 0].plot(time, d_pos)
axs[1, 0].set_title("xd")
axs[2, 0].plot(time, dd_pos)
axs[2, 0].set_title("xdd")
axs[0, 1].plot(time, angle)
axs[0, 1].set_title("theta")
axs[1, 1].plot(time, d_angle)
axs[1, 1].set_title("theta d")
axs[2, 1].plot(time, dd_angle)
axs[2, 1].set_title("theta dd")
fig.tight_layout()
def show_plot(self):
plt.show()