Commit new graphs

This commit is contained in:
2023-03-19 21:56:58 +00:00
parent da4d5a38aa
commit cf8fb79331
11 changed files with 11404 additions and 1031880 deletions
+52
View File
@@ -0,0 +1,52 @@
import numpy as np
from matplotlib import pyplot as plt
from lib.lib import mean_across, read_xyz_alt, read_load
c_direct_neighbours = read_load("../data/c-3d-direct-neighbours", read_xyz_alt)
direct_meaned_by_N = mean_across(c_direct_neighbours)
rust_direct = read_load("../data/rust-3d", read_xyz_alt)
rust_direct_meaned_by_N = mean_across(rust_direct)
rust_offaxis = read_load("../data/rust-3d-offaxis", read_xyz_alt)
rust_offaxis_meaned_by_N = mean_across(rust_direct)
fig, ax = plt.subplots(figsize=(6, 6))
def nc_fd(df, label, color=None, ignore_prefix=0, no_error=False, **kwargs):
if not no_error:
plt.fill_between(
df.N,
# TODO Check error math here
(df[ignore_prefix:]['fd']['mean'] - df[ignore_prefix:]['fd']['stderr']),
(df[ignore_prefix:]['fd']['mean'] + df[ignore_prefix:]['fd']['stderr']),
color=color,
alpha=0.2,
label=f"{label}, standard error band"
)
plt.plot(
df.N,
df['fd']['mean'],
color=color,
label=f"{label}, fd mean",
**kwargs
)
# %%
nc_fd(direct_meaned_by_N, label="IPC + 3D Direct", color="tab:blue", no_error=True)
nc_fd(rust_direct_meaned_by_N, label="NF 3D Direct", color="tab:orange", no_error=True)
nc_fd(rust_offaxis_meaned_by_N, label="NF 3D Off-axis", color="tab:purple", linestyle='dashdot', no_error=True)
plt.plot([np.min(c_direct_neighbours.N), np.max(c_direct_neighbours.N)], [2.5, 2.5], color='tab:red', label='Literature')
# plt.fill_between(c_direct_neighbours.N, 2.5 - 0.01, 2.5 + 0.01, alpha=0.2, color='tab:red', label='Literature error band')
plt.xlabel("$N_C$")
plt.ylabel("$fd$ (instantaneous)")
plt.legend()
plt.savefig('../figures/3d-nc-fd-convergence.svg')
plt.savefig('../figures/3d-nc-fd-convergence.png')
+2 -2
View File
@@ -24,8 +24,8 @@ plt.plot(
color='tab:blue', label='fd mean, seeds = 20'
)
plt.plot([50, 10000], [1.71, 1.71], color='red', label='Theory')
plt.fill_between(without_prefix.N, 1.71 - 0.01, 1.71 + 0.01, alpha=0.2, label='Theory error band')
plt.plot([50, 10000], [1.71, 1.71], color='red', label='Literature')
plt.fill_between(without_prefix.N, 1.71 - 0.01, 1.71 + 0.01, alpha=0.2, label='Literature error band')
plt.xlabel("$N_C$")
plt.ylabel("$fd$ (instantaneous)")
+4 -2
View File
@@ -2,17 +2,19 @@ from matplotlib import pyplot as plt
from lib.lib import read_sp, aggregate_sp_fd
data_2d_sp = read_sp("../data/stick-probability")
data_2d_sp = read_sp("../data/rust-stick-probability")
data_2d_sp_low_p = read_sp("../data/rust-sp-low-p")
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.plot(sp_fd_data.index, sp_fd_data.fd, color='tab:blue', label='NF, 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()