more peak annotation sin figure 4
This commit is contained in:
38
regimes.py
38
regimes.py
@@ -241,6 +241,12 @@ def plot_psd(ax, s, path, contrast, spikes, nfft, dt, beatf1, beatf2, eodf):
|
||||
# mark frequencies:
|
||||
ax.plot(eodf, decibel(peak_ampl(freqs, psd, eodf)) + offs,
|
||||
label=r'$f_{EOD}$', clip_on=False, zorder=50, **s.psFEOD)
|
||||
if contrast < alphas[1]:
|
||||
ax.text(eodf + 40, -2, '$f_{EOD}$', va='center', color=s.psFEOD['color'])
|
||||
ax.text(eodf + beatf1 + 30, -36, '$f_1$', color=s.psFEOD['color'])
|
||||
#ax.text(beatf1 + 10, -30, r'$\Delta f_1$', ha='center', color=s.psF01['color'])
|
||||
ax.text(beatf2 + 10, -24, '$r$', ha='center', color=s.psF0['color'])
|
||||
#ax.text(beatf2 + 10, -16, r'$\Delta f_2$', ha='center', color=s.psF02['color'])
|
||||
ax.plot(beatf2, decibel(peak_ampl(freqs, psd, beatf2)) + offs,
|
||||
label=r'$r$', clip_on=False, zorder=50, **s.psF0)
|
||||
ax.plot(beatf1, decibel(peak_ampl(freqs, psd, beatf1)) + offs,
|
||||
@@ -256,14 +262,23 @@ def plot_psd(ax, s, path, contrast, spikes, nfft, dt, beatf1, beatf2, eodf):
|
||||
ax.plot(eodf - beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf1)) + offsm, **s.psFEODm)
|
||||
if contrast >= alphas[1]:
|
||||
ax.plot(eodf - beatf2, decibel(peak_ampl(freqs, psd, eodf - beatf2)) + offsm,
|
||||
label=r'$f_{EOD} - k \Delta f_2$', zorder=40, **s.psF0m)
|
||||
label=r'$f_{EOD} \pm \Delta f_2$', zorder=40, **s.psF0m)
|
||||
ax.plot(eodf + beatf2, decibel(peak_ampl(freqs, psd, eodf - beatf2)) + offsm,
|
||||
zorder=40, **s.psF0m)
|
||||
if contrast < alphas[2]:
|
||||
ax.text(eodf + beatf2 + 10, -25, '$f_2$', ha='center', color=s.psF0['color'])
|
||||
if contrast >= alphas[2]:
|
||||
ax.plot(2*beatf1, decibel(peak_ampl(freqs, psd, 2*beatf1)) + offsm,
|
||||
label=r'$k\Delta f_1$', zorder=40, **s.psF01m)
|
||||
ax.plot(eodf + 2*beatf1, decibel(peak_ampl(freqs, psd, eodf + 2*beatf1)) + offsm, zorder=40, **s.psFEODm)
|
||||
ax.plot(eodf - beatf2 + beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 + beatf1)) + offsm,
|
||||
label=r'$f_{EOD} - \Delta f_2 \pm k\Delta f_1$', zorder=40, **s.psF02m)
|
||||
ax.plot(eodf - beatf2 - beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 - beatf1)) + offsm, zorder=40, **s.psF02m)
|
||||
label=r'$f_{EOD} \pm \Delta f_2 \pm \Delta f_1$', zorder=40, **s.psF02m)
|
||||
ax.plot(eodf - beatf2 - beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 - beatf1)) + offsm,
|
||||
zorder=40, **s.psF02m)
|
||||
ax.plot(eodf + beatf2 + beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 - beatf1)) + offsm,
|
||||
zorder=40, **s.psF02m)
|
||||
ax.plot(eodf + beatf2 - beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 - beatf1)) + offsm,
|
||||
zorder=40, **s.psF02m)
|
||||
if contrast >= alphas[3]:
|
||||
ax.plot(beatf2 + 2*beatf1, decibel(peak_ampl(freqs, psd, beatf2 + 2*beatf1)) + offsm,
|
||||
label=r'$\Delta f_2 \pm k\Delta f_1$', zorder=40, **s.psF012m)
|
||||
@@ -274,13 +289,14 @@ def plot_psd(ax, s, path, contrast, spikes, nfft, dt, beatf1, beatf2, eodf):
|
||||
ax.plot(4*beatf1, decibel(peak_ampl(freqs, psd, 4*beatf1)) + offsm, zorder=40, **s.psF01m)
|
||||
ax.plot(eodf - 2*beatf1, decibel(peak_ampl(freqs, psd, eodf - 2*beatf1)) + offsm, zorder=40, **s.psFEODm)
|
||||
ax.plot(eodf - 3*beatf1, decibel(peak_ampl(freqs, psd, eodf - 3*beatf1)) + offsm, zorder=40, **s.psFEODm)
|
||||
ax.plot(eodf - 4*beatf1, decibel(peak_ampl(freqs, psd, eodf - 4*beatf1)) + offsm, zorder=40, **s.psFEODm)
|
||||
ax.plot(eodf - 2*beatf2, decibel(peak_ampl(freqs, psd, eodf - 2*beatf2)) + offsm, zorder=40, **s.psF0m)
|
||||
ax.plot(eodf - beatf2 + 2*beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 + 2*beatf1)) + offsm,
|
||||
zorder=40, **s.psF02m)
|
||||
ax.plot(eodf - beatf2 + 3*beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 + 2*beatf1)) + offsm,
|
||||
zorder=40, **s.psF02m)
|
||||
#ax.plot(eodf - 4*beatf1, decibel(peak_ampl(freqs, psd, eodf - 4*beatf1)) + offsm, zorder=40, **s.psFEODm)
|
||||
#ax.plot(eodf - 2*beatf2, decibel(peak_ampl(freqs, psd, eodf - 2*beatf2)) + offsm, zorder=40, **s.psF0m)
|
||||
#ax.plot(eodf - beatf2 + 2*beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 + 2*beatf1)) + offsm,
|
||||
# zorder=40, **s.psF02m)
|
||||
#ax.plot(eodf - beatf2 + 3*beatf1, decibel(peak_ampl(freqs, psd, eodf - beatf2 + 2*beatf1)) + offsm,
|
||||
# zorder=40, **s.psF02m)
|
||||
ax.set_xlim(0, 750)
|
||||
ax.set_xlim(0, 950)
|
||||
ax.set_ylim(-60, 0)
|
||||
ax.set_xticks_delta(200)
|
||||
ax.set_yticks_delta(20)
|
||||
@@ -392,8 +408,8 @@ if __name__ == '__main__':
|
||||
|
||||
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(f' eodf = {eodf:.0f}Hz')
|
||||
print(f' f1 = {eodf + beatf1:.0f}Hz, f2 = {eodf + beatf2:.0f}Hz, eodf = {eodf:.0f}Hz')
|
||||
print(f' Df1 = {beatf1:.0f}Hz, Df2 = {beatf2:.0f}Hz')
|
||||
print()
|
||||
|
||||
s = plot_style()
|
||||
|
||||
Reference in New Issue
Block a user