Made fig_invariance_rect_lp.pdf and corresponding appendix figure.
Adjusted fig_invariance_log_hp.pdf with 2nd yaxis in dB. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import plotstyle_plt
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from thunderhopper.modeltools import load_data
|
||||
from thunderhopper.filetools import search_files, crop_paths
|
||||
from scipy.stats import norm
|
||||
from plot_functions import xlabel, ylabel
|
||||
from IPython import embed
|
||||
|
||||
@@ -26,10 +25,22 @@ fig_kwargs = dict(
|
||||
)
|
||||
)
|
||||
line_kwargs = dict(
|
||||
color='black',
|
||||
c='black',
|
||||
lw=1,
|
||||
alpha=0.5,
|
||||
)
|
||||
fit_kwargs = dict(
|
||||
c='red',
|
||||
lw=3,
|
||||
ls='--',
|
||||
)
|
||||
grid_line_kwargs = dict(
|
||||
visible=True,
|
||||
which='major',
|
||||
axis='both',
|
||||
color='k',
|
||||
lw=0.5,
|
||||
)
|
||||
xlab = '$\\text{multiple of }\\sigma_{k_i}$'
|
||||
ylab = '$P\\,(c_i > \\Theta_i)$'
|
||||
xlab_kwargs = dict(
|
||||
@@ -50,15 +61,20 @@ data = dict(np.load(thresh_path))
|
||||
factors = data['factors']
|
||||
perc = data['percs']
|
||||
|
||||
# Get Gaussian CDF for reference:
|
||||
fit = norm.cdf(factors, loc=0, scale=1)[::-1]
|
||||
|
||||
# Prepare graph:
|
||||
fig, ax = plt.subplots(**fig_kwargs)
|
||||
ax.grid(**grid_line_kwargs)
|
||||
ax.set_xlim(factors[0], factors[-1])
|
||||
ax.set_ylim(0, 1)
|
||||
ax.set_ylim(-0.01, 1.01)
|
||||
ylabel(ax, ylab, transform=fig.transFigure, **ylab_kwargs)
|
||||
xlabel(ax, xlab, transform=fig.transFigure, **xlab_kwargs)
|
||||
|
||||
# Plotting:
|
||||
ax.plot(factors, perc, **line_kwargs)
|
||||
ax.plot(factors, fit, **fit_kwargs)
|
||||
|
||||
# Save figure:
|
||||
fig.savefig(save_path)
|
||||
|
||||
Reference in New Issue
Block a user