from matplotlib import pyplot as plt

from lib.lib import read_sp, read_xyz_alt, aggregate_sp_fd

data_3d_sp = read_sp("../data/rust-3d-offaxis-sp", read_xyz_alt)
sp_fd_data = aggregate_sp_fd(data_3d_sp)

# %%
plt.fill_between(sp_fd_data.index, sp_fd_data.fd - sp_fd_data.fd_std, sp_fd_data.fd + sp_fd_data.fd_std, alpha=0.2, label=f"Standard error band")
plt.plot(sp_fd_data.index, sp_fd_data.fd, color='tab:blue', label='fd mean, seeds = 100')

plt.xlabel("$p_{stick}$")
plt.ylabel("$fd$")
plt.legend()

plt.savefig('../figures/sp-fd-3d.svg')
plt.savefig('../figures/sp-fd-3d.png')
plt.show()
