-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_rmses_cloth.py
40 lines (34 loc) · 1.44 KB
/
plot_rmses_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
'''
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})
ms = np.logspace(1, 2.6, num=20, dtype=int) # np.arange(10, 200, 15)
plt.figure(figsize=[8, 4])
path_to_experiment = pathlib.Path(f"./8x8_cloth_swing_xyz")
for i, kapprox in enumerate(['nystrom', 'splines']):
pathdata = pathlib.Path(f"{path_to_experiment}/sim_results/{kapprox}/data")
rmses = np.loadtxt(f"{pathdata}/all_rmses_{kapprox}_cloth_swing_angle.csv") if kapprox == 'nystrom' else np.loadtxt(f"{pathdata}/all_rmses_{kapprox}_cloth_swing_angle.csv")
plt.plot(ms, np.median(rmses, axis=0), color=f'C{i}', linewidth=2)
plt.fill_between(ms, np.percentile(rmses, axis=0, q=15),
np.percentile(rmses, axis=0, q=85), alpha=0.3, color=f'C{i}', label='_nolegend_')
plt.ylabel(r'$\mathrm{RMSE}$ [m]')
plt.xlabel('$m$')
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.ylim(0.03, 0.4)
plt.grid(visible=True, which='both')
plt.tight_layout()
plt.savefig(f"reshaped_cloth_swing_rmse.png", dpi=300, bbox_inches='tight',
pad_inches=0)
plt.show()