-
Notifications
You must be signed in to change notification settings - Fork 5
/
tikz_plot_generator.py
60 lines (38 loc) · 1.43 KB
/
tikz_plot_generator.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import matplotlib
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
def load_df():
network_df = pd.read_pickle("data/mpc_data/05_27_20/mpc_simulation_df_00_45_24_EULER.pkl")
return network_df
def plot_df(network_df):
# ON OFF CONTROLLER
# pump1/2 current_setting
# t1/t2 depth, flooding
# disturbances, same as the flow of the pumps
fig, axes = plt.subplots(nrows=4, ncols=1)
network_df["pump1_current_setting"].plot(ax=axes[0])
network_df["pump2_current_setting"].plot(ax=axes[0])
axes[0].set_title("Pump current settings [CMS]")
axes[0].legend(["Pump 1", "Pump 2"])
axes[0].grid()
network_df["tank1_depth"].plot(ax=axes[1])
network_df["tank2_depth"].plot(ax=axes[1])
axes[1].set_title("Tank depth [m]")
axes[1].legend(["Tank 1", "Tank 2"])
axes[1].grid()
network_df["tank1_flooding"].plot(ax=axes[2])
network_df["tank2_flooding"].plot(ax=axes[2])
axes[2].set_title("Tank flooding [m]")
axes[2].legend(["Tank 1", "Tank 2"])
axes[2].grid()
# axes[2].yaxis.set_major_formatter(ticker.FormatStrFormatter('%1'))
network_df["disturbance"].plot(ax=axes[3])
axes[3].set_title("Combined disturbance [CMS]")
axes[3].legend(["Disturbance"])
axes[3].grid()
plt.savefig("data/figures/final_local_model.png")
plt.show()
if __name__ == "__main__":
network_df = load_df()
plot_df(network_df)