-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_reg_error_cloth.py
42 lines (38 loc) · 1.5 KB
/
plot_reg_error_cloth.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
'''
Author: Edoardo Caldarelli
Affiliation: Institut de Robòtica i Informàtica Industrial, CSIC-UPC
email: [email protected]
January 2024
'''
import numpy as np
import matplotlib.pyplot as plt
import pathlib
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.rcParams.update({'font.size': 22})
times = np.arange(0.0, 5.05, 0.05)
plt.figure(figsize=[8, 4])
path_to_experiment = pathlib.Path(f"./8x8_cloth_swing_xyz")
n_seeds = 50
n_states = 192
for i, kapprox in enumerate(['nys', 'splines']):
all_rmses = []
for seed in range(0, n_seeds):
rmses = np.loadtxt(f"{path_to_experiment}/sim_results/REBUTTAL_rmse_{kapprox}_seed_{seed}.csv", delimiter=',') / np.sqrt(n_states)
all_rmses.append(rmses)
plt.plot(times, np.median(all_rmses, axis=0), color=f'C{i}', linewidth=2)
plt.fill_between(times, np.percentile(all_rmses, axis=0, q=15),
np.percentile(all_rmses, axis=0, q=85), alpha=0.3, color=f'C{i}', label='_nolegend_')
# plt.plot(times, np.array(all_rmses).T, color=f'C{i}', linewidth=0.5, alpha=0.7)
plt.ylabel(r'$\mathrm{RMSE}$ [m]')
plt.xlabel('$\mathrm{t}$ [s]')
plt.legend(["Nyström RBF", "Splines"], bbox_to_anchor=(0.0, 1.02, 1.0, 0.2), loc='lower left',
mode='expand',
borderaxespad=0, ncol=3, handlelength=1.0)
#plt.yscale('log')
#plt.xscale('log')
plt.grid(visible=True, which='both')
plt.tight_layout()
plt.savefig(f"rebuttal_cloth_swing_regulation_rmse.png", dpi=300, bbox_inches='tight',
pad_inches=0)
plt.show()