yall.append(mante.plot_unit(unit, sortedfile, mante_plots, t0=stimulus_start, tmin=stimulus_start, tmax=stimulus_end, sortby_fontsize=sortby_fontsize, unit_fontsize=6)) # Shared x tick labels for i in xrange(len(units)): plots[str(i)+'_choice'].xticklabels() plots[str(i)+'_motion_choice'].xticklabels() plots[str(i)+'_colour_choice'].xticklabels() # Shared y limits shared_plots = [] for i in xrange(len(units)): shared_plots += [plots[str(i)+'_'+s] for s in ['choice', 'motion_choice', 'colour_choice', 'context_choice']] ylim = fig.shared_lim(shared_plots, 'y', yall) # Shared y tick labels plots['0_choice'].yticks([0]) plots['0_motion_choice'].yticks([0]) plots['0_colour_choice'].yticks([0]) plots['0_context_choice'].yticks([0]) for i in xrange(1, len(units)): for s in ['choice', 'motion_choice', 'colour_choice', 'context_choice']: plots[str(i)+'_'+s].yticks(plots['0_'+s].get_yticks()) plots[str(i)+'_'+s].yticklabels() #========================================================================================= # Regression coefficients #=========================================================================================
unit_fontsize=6)) # Shared x tick labels for i in xrange(len(units)): plots[str(i) + '_choice'].xticklabels() plots[str(i) + '_motion_choice'].xticklabels() plots[str(i) + '_colour_choice'].xticklabels() # Shared y limits shared_plots = [] for i in xrange(len(units)): shared_plots += [ plots[str(i) + '_' + s] for s in ['choice', 'motion_choice', 'colour_choice', 'context_choice'] ] ylim = fig.shared_lim(shared_plots, 'y', yall) # Shared y tick labels plots['0_choice'].yticks([0]) plots['0_motion_choice'].yticks([0]) plots['0_colour_choice'].yticks([0]) plots['0_context_choice'].yticks([0]) for i in xrange(1, len(units)): for s in ['choice', 'motion_choice', 'colour_choice', 'context_choice']: plots[str(i) + '_' + s].yticks(plots['0_' + s].get_yticks()) plots[str(i) + '_' + s].yticklabels() #========================================================================================= # Regression coefficients #=========================================================================================
if modality == 'v': plot_inputs(trial, 'v', all) v = True elif modality == 'a': plot_inputs(trial, 'a', all) a = True elif modality == 'va': plot_inputs(trial, 'va', all) va = True if v and a and va: break # Shared axes names = ['v_v', 'v_a', 'a_v', 'a_a', 'va_v', 'va_a'] fig.shared_lim([plots[p] for p in names], 'y', [0, 1.75], margin=0) for name in names: plot = plots[name] plot.xlim(tmin - t0, tmax - t0) plot.xticks([tmin - t0, 0, tmax - t0]) plot.yticks([0, 1]) if not name.startswith('v_'): plot.yticklabels() if name != 'v_a': plot.xticklabels() #========================================================================================= # Psychometric functions #========================================================================================= plot = plots['psy']
if modality == 'v': plot_inputs(trial, 'v', all) v = True elif modality == 'a': plot_inputs(trial, 'a', all) a = True elif modality == 'va': plot_inputs(trial, 'va', all) va = True if v and a and va: break # Shared axes names = ['v_v', 'v_a', 'a_v', 'a_a', 'va_v', 'va_a'] fig.shared_lim([plots[p] for p in names], 'y', [0, 1.75], margin=0) for name in names: plot = plots[name] plot.xlim(tmin-t0, tmax-t0) plot.xticks([tmin-t0, 0, tmax-t0]) plot.yticks([0, 1]) if not name.startswith('v_'): plot.yticklabels() if name != 'v_a': plot.xticklabels() #========================================================================================= # Psychometric functions #========================================================================================= plot = plots['psy']
plot = plots[">"] plot.plot(t, rnn.u[0], color=Figure.colors("orange"), lw=0.5) yall.append(rnn.u[0]) plot.xticklabels() trial_args = {"name": "test", "catch": False, "fpair": (34, 26), "gt_lt": "<"} info = rnn.run(inputs=(trial_func, trial_args), rng=rng) # f1 < f2 plot = plots["<"] plot.plot(t, rnn.u[0], color=Figure.colors("purple"), lw=0.5) yall.append(rnn.u[0]) # Shared axes input_plots = [plots[">"], plots["<"]] ymin, ymax = fig.shared_lim(input_plots, "y", yall, lower=0) for plot in input_plots: plot.xlim(t[0], t[-1]) plot.xticks([0, 1, 2, 3, 4]) plot.yticks([0, 1]) # Delay epoch plot = plots[">"] plot.plot(delay, 1.1 * ymax * np.ones(2), color="k", lw=1.5) plot.text(np.mean(delay), 1.15 * ymax, "Delay", ha="center", va="bottom", fontsize=5.5) # Conditions plots[">"].text( np.mean(delay), 0.9 * ymax, "$f_1 > f_2$", ha="center", va="top", color=Figure.colors("orange"), fontsize=6 ) plots["<"].text(
trial_args = { 'name': 'test', 'catch': False, 'fpair': (34, 26), 'gt_lt': '<' } info = rnn.run(inputs=(trial_func, trial_args), rng=rng) # f1 < f2 plot = plots['<'] plot.plot(t, rnn.u[0], color=Figure.colors('purple'), lw=0.5) yall.append(rnn.u[0]) # Shared axes input_plots = [plots['>'], plots['<']] ymin, ymax = fig.shared_lim(input_plots, 'y', yall, lower=0) for plot in input_plots: plot.xlim(t[0], t[-1]) plot.xticks([0, 1, 2, 3, 4]) plot.yticks([0, 1]) # Delay epoch plot = plots['>'] plot.plot(delay, 1.1*ymax*np.ones(2), color='k', lw=1.5) plot.text(np.mean(delay), 1.15*ymax, 'Delay', ha='center', va='bottom', fontsize=5.5) # Conditions plots['>'].text(np.mean(delay), 0.9*ymax, '$f_1 > f_2$', ha='center', va='top', color=Figure.colors('orange'), fontsize=6) plots['<'].text(np.mean(delay), 0.9*ymax, '$f_1 < f_2$', ha='center', va='top', color=Figure.colors('purple'), fontsize=6)