diff --git a/code/eod_chirp_beat.py b/code/eod_chirp_beat.py index 072cca7..2ff6e6d 100644 --- a/code/eod_chirp_beat.py +++ b/code/eod_chirp_beat.py @@ -81,8 +81,8 @@ ax3.set_ylabel('EOD [mV]', fontsize=22) ax3.xaxis.set_tick_params(labelsize=18) ax3.yaxis.set_tick_params(labelsize=18) -ax3.set_xlabel('time [ms]', fontsize=22) -ax4.set_xlabel('time [ms]', fontsize=22) +ax3.set_xlabel('Time [ms]', fontsize=22) +ax4.set_xlabel('Time [ms]', fontsize=22) ax4.xaxis.set_tick_params(labelsize=18) ax4.set_yticklabels([]) diff --git a/code/eod_freq_beat.py b/code/eod_freq_beat.py index 04ed6e7..5e3241d 100644 --- a/code/eod_freq_beat.py +++ b/code/eod_freq_beat.py @@ -25,19 +25,19 @@ time_axis = np.arange(len(ampl)) fig, ax = plt.subplots(figsize=(20/inch_factor, 10/inch_factor)) -plt.plot(time[10000:20000], ampl) -plt.plot(time[10000:20000][p], ampl[p], lw=2, color='k') -plt.plot(time[10000:20000][t], ampl[t], lw=2, color='k') -ax.set_xlabel("time [ms]", fontsize = 22) +plt.plot(time[10000:20000]*1000, ampl, color='royalblue') +plt.plot(time[10000:20000][p]*1000, ampl[p], lw=2, color='k') +plt.plot(time[10000:20000][t]*1000, ampl[t], lw=2, color='k') +ax.set_xlabel("Time [ms]", fontsize = 22) plt.xticks(fontsize = 18) -ax.set_ylabel("eod amplitude [mV]", fontsize = 22) +ax.set_ylabel("EOD amplitude [mV]", fontsize = 22) plt.yticks(fontsize = 18) ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) fig.tight_layout() -plt.show() -#plt.savefig('beat.png') +#plt.show() +plt.savefig('beat.png') diff --git a/code/plot_eodform_spikehist.py b/code/plot_eodform_spikehist.py index e7a5cdd..3a1a0e6 100644 --- a/code/plot_eodform_spikehist.py +++ b/code/plot_eodform_spikehist.py @@ -9,8 +9,8 @@ from IPython import embed inch_factor = 2.54 sampling_rate = 40000 data_dir = '../data' -#dataset = '2018-11-09-ad-invivo-1' -dataset = '2018-11-14-ad-invivo-1' +dataset = '2018-11-09-ad-invivo-1' +#dataset = '2018-11-14-ad-invivo-1' # read eod and time of baseline time, eod = read_baseline_eod(os.path.join(data_dir, dataset)) @@ -26,7 +26,6 @@ eod_times = time[(eod_norm >= threshold) & (shift_eod < threshold)] eod_duration = eod_times[2]- eod_times[1] #time in s -eod_duration = eod_times[2]- eod_times[1] @@ -37,9 +36,9 @@ interspikeintervals = np.diff(spikes)/eod_duration fig, ax = plt.subplots(figsize=(20/inch_factor, 10/inch_factor)) plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.1), color='royalblue') -plt.xlabel("eod cycles", fontsize = 22) +plt.xlabel("EOD cycles", fontsize = 22) plt.xticks(fontsize = 18) -plt.ylabel("number of \n interspikeintervals", fontsize = 22) +plt.ylabel("Number of \n interspikeintervals", fontsize = 22) plt.yticks(fontsize = 18) ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) @@ -91,8 +90,8 @@ time_axis = np.arange(max_cut)/sampling_rate*1000 # plot eod form and spike histogram fig, ax1 = plt.subplots(figsize=(20/inch_factor, 10/inch_factor)) ax1.hist(spike_times, color='firebrick') -ax1.set_xlabel('time [ms]', fontsize=22) -ax1.set_ylabel('number', fontsize=22) +ax1.set_xlabel('Time [ms]', fontsize=22) +ax1.set_ylabel('Number', fontsize=22) ax1.tick_params(axis='y', labelcolor='firebrick') plt.xticks(fontsize=18) plt.yticks(fontsize=18) @@ -101,7 +100,7 @@ ax1.spines['top'].set_visible(False) ax2 = ax1.twinx() ax2.fill_between(time_axis, mu_eod+std_eod, mu_eod-std_eod, color='royalblue', alpha=0.5) ax2.plot(time_axis, mu_eod, color='black', lw=2) -ax2.set_ylabel('voltage [mV]', fontsize=22) +ax2.set_ylabel('Voltage [mV]', fontsize=22) ax2.tick_params(axis='y', labelcolor='royalblue') ax2.spines['top'].set_visible(False) diff --git a/code/repetition_firingrate.py b/code/repetition_firingrate.py index 1047b45..9dee716 100644 --- a/code/repetition_firingrate.py +++ b/code/repetition_firingrate.py @@ -87,15 +87,15 @@ for df in df_phase_time.keys(): ax[1].plot(time_axis[0+5*sampling_rate:-5*sampling_rate], smoothed_spikes[0+5*sampling_rate:-5*sampling_rate]*1000, color='royalblue', lw = 2) - ax[0].set_title('df = %s Hz' %(df), fontsize = 18) - ax[0].set_ylabel('repetition', fontsize=22) + ax[0].set_title('$\Delta$f = %s Hz' %(df), fontsize = 18) + ax[0].set_ylabel('Repetition', fontsize=22) ax[0].yaxis.set_label_coords(-0.1, 0.5) ax[0].set_yticks(np.arange(1, len(plot_trials)+1,2)) ax[0].set_yticklabels(np.arange(1, len(plot_trials)+1,2), fontsize=18) - ax[1].set_xlabel('time [ms]', fontsize=22) + ax[1].set_xlabel('Time [ms]', fontsize=22) ax[1].yaxis.set_label_coords(-0.1, 0.5) - ax[1].set_ylabel('firing rate [Hz]', fontsize=22) + ax[1].set_ylabel('Firing rate [Hz]', fontsize=22) plt.xticks(fontsize=18) plt.yticks(fontsize=18) fig.tight_layout() diff --git a/code/stimulus_chirp.py b/code/stimulus_chirp.py index 0e01894..89d0082 100644 --- a/code/stimulus_chirp.py +++ b/code/stimulus_chirp.py @@ -43,15 +43,19 @@ plt.setp(ax1.get_xticklabels(), visible=False) ax1.plot(time*1000, signal, color = 'royalblue', lw = 1) ax2.plot(time*1000, freq, color = 'royalblue', lw = 3) -ax1.set_ylabel("field [mV]", fontsize = 22) +ax1.set_ylabel("Field [mV]", fontsize = 22) ax1.yaxis.set_label_coords(-0.1, 0.5) -ax2.set_xlabel("time [ms]", fontsize = 22) -ax2.set_ylabel("frequency [Hz]", fontsize = 22) +ax2.set_xlabel("Time [ms]", fontsize = 22) +ax2.set_ylabel("Frequency [Hz]", fontsize = 22) ax2.yaxis.set_label_coords(-0.1, 0.5) plt.xticks(fontsize=18) plt.yticks(fontsize=18) +ax1.spines["top"].set_visible(False) +ax1.spines["right"].set_visible(False) +ax2.spines["top"].set_visible(False) +ax2.spines["right"].set_visible(False) fig.tight_layout() -plt.show() -#plt.savefig('stimulus_chirp.png') +#plt.show() +plt.savefig('stimulus_chirp.png')