from matplotlib import pyplot as plt

from lib.lib import read_sp, aggregate_sp_fd

data_2d_sp = read_sp("../data/stick-probability")
sp_fd_data = aggregate_sp_fd(data_2d_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.svg')
plt.savefig('../figures/sp-fd.png')
plt.show()
