[54ded2]: / experiments / simulations / plot_errors.py

Download this file

84 lines (64 with data), 1.6 kB

 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import matplotlib
font = {"size": 30}
matplotlib.rc("font", **font)
matplotlib.rcParams["text.usetex"] = True
error_df_n_outputs = pd.read_csv("./out/error_vary_n_outputs.csv", index_col=0)
error_df_warp_magnitude = pd.read_csv(
"./out/error_vary_warp_magnitude.csv", index_col=0
)
error_df_noise_variance = pd.read_csv(
"./out/error_vary_noise_variance.csv", index_col=0
)
# import ipdb; ipdb.set_trace()
plt.figure(figsize=(20, 5))
plt.subplot(131)
g = sns.lineplot(
data=error_df_n_outputs, x="variable", y="value", hue="method", err_style="bars"
)
# plt.legend(
# bbox_to_anchor=(1.1, 1.05), loc=2, borderaxespad=0.,
# )
# g.legend_.set_title(None)
g.legend_.remove()
plt.xlabel("Number of outputs")
plt.ylabel("Error")
plt.subplot(132)
g = sns.lineplot(
data=error_df_warp_magnitude,
x="variable",
y="value",
hue="method",
err_style="bars",
)
# plt.legend(
# bbox_to_anchor=(1.1, 1.05), loc=2, borderaxespad=0.,
# )
# g.legend_.set_title(None)
g.legend_.remove()
plt.xlabel("Magnitude of distortion")
plt.ylabel("Error")
plt.tight_layout()
plt.subplot(133)
g = sns.lineplot(
data=error_df_noise_variance,
x="variable",
y="value",
hue="method",
err_style="bars",
)
plt.legend(
bbox_to_anchor=(1.1, 1.05),
loc=2,
borderaxespad=0.0,
)
g.legend_.set_title(None)
plt.xlabel("Noise variance")
plt.ylabel("Error")
plt.tight_layout()
plt.savefig("../../plots/error_plot.png")
plt.show()
import ipdb
ipdb.set_trace()