Finished (:D) fig_invariance_log_hp.pdf.
Added movable label string to time_bar().
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import plotstyle_plt
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from itertools import product
|
||||
from thunderhopper.filetools import search_files
|
||||
from thunderhopper.modeltools import load_data
|
||||
from thunderhopper.filtertools import find_kern_specs
|
||||
@@ -116,6 +115,14 @@ snip_specs = dict(
|
||||
inset_bounds = [1.02, 0, 0.2, 1]
|
||||
|
||||
# PLOT SETTINGS:
|
||||
fs = dict(
|
||||
lab_norm=16,
|
||||
lab_tex=20,
|
||||
letter=22,
|
||||
tit_norm=16,
|
||||
tit_tex=20,
|
||||
bar=16,
|
||||
)
|
||||
colors = load_colors('../data/stage_colors.npz')
|
||||
color_factors = [0.2, -0.2]
|
||||
lw = dict(
|
||||
@@ -136,32 +143,32 @@ ylabels = dict(
|
||||
)
|
||||
xlab_snip_kwargs = dict(
|
||||
y=0,
|
||||
fontsize=16,
|
||||
fontsize=fs['lab_norm'],
|
||||
ha='center',
|
||||
va='bottom',
|
||||
)
|
||||
xlab_big_kwargs = dict(
|
||||
y=0,
|
||||
fontsize=16,
|
||||
fontsize=fs['lab_norm'],
|
||||
ha='center',
|
||||
va='bottom',
|
||||
)
|
||||
ylab_snip_kwargs = dict(
|
||||
x=0.08,
|
||||
fontsize=20,
|
||||
fontsize=fs['lab_tex'],
|
||||
rotation=0,
|
||||
ha='right',
|
||||
va='center',
|
||||
)
|
||||
ylab_super_kwargs = dict(
|
||||
x=0,
|
||||
fontsize=16,
|
||||
fontsize=fs['lab_norm'],
|
||||
ha='left',
|
||||
va='center',
|
||||
)
|
||||
ylab_big_kwargs = dict(
|
||||
x=0,
|
||||
fontsize=20,
|
||||
fontsize=fs['lab_norm'],
|
||||
ha='center',
|
||||
va='top',
|
||||
)
|
||||
@@ -176,21 +183,21 @@ title_kwargs = dict(
|
||||
yref=1,
|
||||
ha='center',
|
||||
va='top',
|
||||
fontsize=16,
|
||||
fontsize=fs['tit_norm'],
|
||||
)
|
||||
letter_snip_kwargs = dict(
|
||||
x=0,
|
||||
y=1,
|
||||
ha='left',
|
||||
va='top',
|
||||
fontsize=22,
|
||||
fontsize=fs['letter'],
|
||||
)
|
||||
letter_big_kwargs = dict(
|
||||
x=0,
|
||||
yref=letter_snip_kwargs['y'],
|
||||
ha='left',
|
||||
va='top',
|
||||
fontsize=22,
|
||||
fontsize=fs['letter'],
|
||||
)
|
||||
dist_kwargs = dict(
|
||||
nbins=50,
|
||||
@@ -203,10 +210,20 @@ dist_fill_kwargs = dict(
|
||||
)
|
||||
bar_time = 0.1
|
||||
bar_kwargs = dict(
|
||||
y0=0.3,
|
||||
y1=0.4,
|
||||
dur=bar_time,
|
||||
y0=-0.25,
|
||||
y1=-0.1,
|
||||
xshift=1,
|
||||
color='k',
|
||||
lw=0,
|
||||
clip_on=False,
|
||||
text_pos=(-0.1, 0.5),
|
||||
text_str=f'${int(1000 * bar_time)}\\,\\text{{ms}}$',
|
||||
text_kwargs=dict(
|
||||
fontsize=fs['bar'],
|
||||
ha='right',
|
||||
va='center',
|
||||
)
|
||||
)
|
||||
kernel = np.array([
|
||||
[1, 0.008],
|
||||
@@ -264,13 +281,12 @@ for data_path in data_paths:
|
||||
ylabel(ax, ylabels[stage], **ylab_snip_kwargs,
|
||||
transform=snip_subfig.transSubfigure)
|
||||
if i == 0:
|
||||
axes[0, 0].set_xlim(t_full[0], t_full[-1])
|
||||
time_bar(axes[0, 0], bar_time, **bar_kwargs)
|
||||
for ax, scale in zip(axes[0, :], data['example_scales']):
|
||||
title = f'$\\alpha={strip_zeros(scale)}$'
|
||||
title_subplot(ax, title, **title_kwargs, ref=fig)
|
||||
elif i == data['threshs'].size - 1:
|
||||
super_xlabel(xlabels['snip'], snip_subfig, axes[-1, 0], axes[-1, -1], **xlab_snip_kwargs)
|
||||
elif i == data['threshs'].size - 1:
|
||||
axes[-1, -1].set_xlim(t_full[0], t_full[-1])
|
||||
time_bar(axes[-1, -1], **bar_kwargs)
|
||||
letter_subplots(snip_axes.keys(), **letter_snip_kwargs)
|
||||
|
||||
# Prepare analysis axis:
|
||||
|
||||
Reference in New Issue
Block a user