updated figure captions

This commit is contained in:
2025-05-22 19:03:41 +02:00
parent ee2b8f98b7
commit 3e07684093
12 changed files with 142 additions and 95 deletions

View File

@@ -153,7 +153,7 @@ def plot_raster(ax, s, spikes, tmax):
def compute_power(path, contrast, spikes, nfft, dt):
if not path.exists():
print(f' Compute power spectrum for contrast = {100*contrast:4.1f}%')
print(f'Compute power spectrum for contrast = {100*contrast:4.1f}%')
psds = []
time = np.arange(nfft + 1)*dt
tmax = nfft*dt
@@ -167,7 +167,7 @@ def compute_power(path, contrast, spikes, nfft, dt):
np.savez(path, nfft=nfft, deltat=dt, nsegs=len(spikes),
freqs=freqs, prr=prr)
else:
print(f' Load power spectrum for contrast = {100*contrast:4.1f}%')
print(f'Load power spectrum for contrast = {100*contrast:4.1f}%')
data = np.load(path)
freqs = data['freqs']
prr = data['prr']
@@ -267,12 +267,16 @@ def plot_peaks(ax, s, alphas, contrasts, powerf1, powerf2, powerfsum,
ax.text(100*alpha, ymax, tag, ha='center')
#ax.axvline(contrast, **s.lsGrid)
#ax.text(contrast, 630, tag, ha='center')
ax.axvline(1.2, **s.lsLine)
ax.axvline(3.5, **s.lsLine)
cthresh1 = 1.2
cthresh2 = 3.5
print(f'Linear regime ends at a contrast of about {cthresh1:4.1f}%')
print(f'Weakly non-linear regime ends at a contrast of about {cthresh2:4.1f}%')
ax.axvline(cthresh1, **s.lsLine)
ax.axvline(cthresh2, **s.lsLine)
yoffs = 35
ax.text(1.2/2, yoffs, 'linear\nregime',
ax.text(cthresh1/2, yoffs, 'linear\nregime',
ha='center', va='center')
ax.text((1.2 + 3.5)/2, yoffs, 'weakly\nnonlinear\nregime',
ax.text((cthresh1 + cthresh2)/2, yoffs, 'weakly\nnonlinear\nregime',
ha='center', va='center')
ax.text(5.5, yoffs, 'strongly\nnonlinear\nregime',
ha='center', va='center')
@@ -294,8 +298,10 @@ if __name__ == '__main__':
cell = cell_parameters(parameters, model_cell)
nfft = 2**18
print(f'Loaded data for cell {model_cell}: '
f'baseline rate = {ratebase:.0f}Hz, CV = {cvbase:.2f}')
print(f'Loaded data for cell {model_cell}: ')
print(f' baseline rate = {ratebase:.0f}Hz, CV = {cvbase:.2f}')
print(f' f1 = {beatf1:.0f}Hz, f2 = {beatf2:.0f}Hz')
print()
s = plot_style()
fig, (axes, axa) = plt.subplots(2, 1, height_ratios=[4, 3],