70 lines
1.5 KiB
Python
70 lines
1.5 KiB
Python
import plotstyle_plt
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
from plot_functions import xlabel, ylabel
|
|
|
|
# GENERAL SETTINGS:
|
|
data_path = '../data/inv/noise_env/sd_conversion.npz'
|
|
save_path = '../figures/fig_noise_env_sd_conversion_appendix.pdf'
|
|
|
|
# PLOT SETTINGS:
|
|
fig_kwargs = dict(
|
|
figsize=(32/2.54, 16/2.54),
|
|
nrows=1,
|
|
ncols=1,
|
|
gridspec_kw=dict(
|
|
wspace=0,
|
|
hspace=0,
|
|
left=0.08,
|
|
right=0.98,
|
|
bottom=0.1,
|
|
top=0.95,
|
|
)
|
|
)
|
|
grid_line_kwargs = dict(
|
|
visible=True,
|
|
which='major',
|
|
axis='both',
|
|
color='k',
|
|
lw=0.5,
|
|
)
|
|
line_kwargs = dict(
|
|
c='k',
|
|
lw=0.5,
|
|
alpha=0.5,
|
|
)
|
|
xlab = '$\\text{scale }\\alpha$'
|
|
xlab_kwargs = dict(
|
|
y=0,
|
|
fontsize=20,
|
|
ha='center',
|
|
va='bottom',
|
|
)
|
|
ylab = '$\\sigma_{\\eta}$'
|
|
ylab_kwargs = dict(
|
|
x=0,
|
|
fontsize=20,
|
|
ha='center',
|
|
va='top',
|
|
)
|
|
|
|
# Fetch data:
|
|
data = dict(np.load('../data/inv/noise_env/sd_conversion.npz'))
|
|
|
|
# Prepare graph:
|
|
fig, ax = plt.subplots(**fig_kwargs)
|
|
ax.grid(**grid_line_kwargs)
|
|
ax.set_xlim(data['scales'][0], data['scales'][-1])
|
|
ax.set_xscale('symlog', linthresh=data['scales'][1], linscale=0.5)
|
|
ax.set_ylim(0, 0.08)
|
|
ax.yaxis.set_major_locator(plt.MultipleLocator(0.02))
|
|
xlabel(ax, xlab, transform=fig.transFigure, **xlab_kwargs)
|
|
ylabel(ax, ylab, transform=fig.transFigure, **ylab_kwargs)
|
|
|
|
# Plot individual trials:
|
|
ax.plot(data['scales'], data['sd_noise'][..., 0], **line_kwargs)
|
|
|
|
if save_path is not None:
|
|
fig.savefig(save_path)
|
|
plt.show()
|