figsize = [s*cm for s in params.total_size]) # make gridspec gs = gridspec.GridSpec(nrows = 1, ncols = 1, figure = fig) # ---------------- top row ---- # panel a ax_a = fig.add_subplot(gs[0, 0]) behavior.bhv_plot( bhv_focl_data, bhv_dist_data, bar1 = 0.69, bar2 = 0.87, ax = ax_a, yrng = pkws.bhv_yrng, pal = pkws.pal_bhv, jitter = 0.08, bootstrap_n = 1000, pkws = postkws, trim_axes = True, offset_axes = 5, yticks = (0.55, 0.95)) util.axis_expand(ax_a, L = -0.13, B = -0.11, R = -0.05, T = 0.1) # save plt.savefig(params.output, transparent = True)
# make figure cm = 1 / 2.54 fig = plt.figure(constrained_layout=False, figsize=[s * cm for s in params.total_size]) # make gridspec gs = gridspec.GridSpec(nrows=3, ncols=2, figure=fig, **pkws.twocol_gridspec) base_a = util.panel_label(fig, gs[0, 0], "a") base_b = util.panel_label(fig, gs[0, 1], "b") base_c = util.panel_label(fig, gs[1, 0], "c") base_d = util.panel_label(fig, gs[2, 0], "d") # ---------------- top row ---- # panel a ax_a = fig.add_subplot(gs[0, 0]) bhv_cis = behavior.bhv_plot(bhv_focl_data, bhv_dist_data, bar1=0.69, bar2=0.87, ax=ax_a, yrng=pkws.bhv_yrng, pal=pkws.pal_bhv, jitter=0.03, bootstrap_n=1000) util.axis_expand(ax_a, L=-0.1, B=0, R=0, T=0) bhv_cis.to_csv(params.bhv_stats_output) # save plt.savefig(params.output, transparent=True)
constrained_layout = False, figsize = [s*cm for s in params.total_size]) # make gridspec gs = gridspec.GridSpec( nrows = 1, ncols = 1, figure = fig,) ax_a = fig.add_subplot(gs[0, 0]) diagrams.rf_ellipses( ax_a, lp_pre_ells, lp_att_ells[3], grads_dist, grads_focl, (0,4,0), params.rf_diagram_units, loc = (56, 56), color_dist = '#000000', color_focl = '#d55c00', pkws = pkws) ax_a.set_ylim([150, 0]) util.axis_expand(ax_a, L = 0.0, B = 0.05, R = 0.05, T = 0.1) util.labels(ax_a, "Image space", "Image space", pkws = pkws) # save plt.savefig(params.output, transparent = True)
sgain_comp = lineplots.gain_data(lp_pre_ells, params.sgain_comp, loc=(56, 56)) import matplotlib sns.set('notebook') sns.set_style('ticks') matplotlib.rcParams.update(pkws.rc) # make figure cm = 1 / 2.54 fig = plt.figure(constrained_layout=False, figsize=[s * cm for s in params.total_size]) # make gridspec gs = gridspec.GridSpec(nrows=1, ncols=1, figure=fig, wspace=0.1, hspace=0.1) """ # panel b ax_d = fig.add_subplot(gs[1, 0]) size_map = quivers.quiverplot( qv_dist_ell, qv_focl_ell, qv_smooth_samp, ax_d, cmap = 'coolwarm', vrng = params.size_lim) util.axis_expand(ax_d, L = 0.2, B = 0.2, R = -0.1, T = 0.05) util.labels(ax_d, pkws.labels.image_position.format('Horizontal'), pkws.labels.image_position.format('Vertical')) util.colorbar( fig, ax_d, size_map, ticks = params.size_lim + (1,), label = pkws.labels.rf_size, label_vofs = -0.03) # panel c : single axis
) ax_e = fig.add_subplot(gs[0, 0]) lineplots.lineplot(lineplots.gain_file_iterator(lp_dists, sgain_focl, (0, 4, 0), gain_comp=sgain_comp), ax_e, line_span=pkws.lineplot_span, rad=30, pal=pkws.pal_b, xlim=(0, 180), ylim=params.gain_lim, pkws=pkws) util.labels(ax_e, pkws.labels.unit_distance, pkws.labels.effective_gain, pkws=pkws) util.legend(fig, ax_e, pkws.labels.beta, pkws.pal_b, inset=pkws.legend_inset, pkws=pkws) ax_e.set_yticks([1, params.gain_lim[1]]) ax_e.set_xticks([0, 150]) sns.despine(ax=ax_e, trim=True, offset=5) util.axis_expand(ax_e, L=-0.07, B=-0.1, R=0.1, T=0.05) # save plt.savefig(params.output, transparent=True)
# make gridspec gs = gridspec.GridSpec( nrows=1, ncols=1, figure=fig, ) ax_d = fig.add_subplot(gs[0, 0]) size_map = quivers.quiverplot(qv_dist_ell, qv_focl_ell, qv_smooth_samp, ax_d, cmap='coolwarm', vrng=params.size_lim, pkws=pkws) util.axis_expand(ax_d, L=0.15, B=0.1, R=-0.11, T=0.15) util.labels(ax_d, pkws.labels.image_position.format('Horizontal'), pkws.labels.image_position.format('Vertical'), pkws=pkws) util.colorbar(fig, ax_d, size_map, ticks=params.size_lim + (1, ), label=pkws.labels.rf_size, label_vofs=-0.12, label_margin=0.04, margin=0.03, width=0.03, pkws=pkws)
base_a = util.panel_label(fig, gs[0, 0], "a") base_b = util.panel_label(fig, gs[1, 0], "b") base_c = util.panel_label(fig, gs[1, 1], "c") base_d = util.panel_label(fig, gs[1, 2], "d") base_e = util.panel_label(fig, gs[2, 0], "e") base_f = util.panel_label(fig, gs[2, 1], "f") # panel b ax_d = fig.add_subplot(gs[1, 0]) size_map = quivers.quiverplot(qv_dist_ell, qv_focl_ell, qv_smooth_samp, ax_d, cmap='coolwarm', vrng=params.size_lim) util.axis_expand(ax_d, L=0.2, B=0.2, R=-0.1, T=0.05) util.labels(ax_d, pkws.labels.image_position.format('Horizontal'), pkws.labels.image_position.format('Vertical')) util.colorbar(fig, ax_d, size_map, ticks=params.size_lim + (1, ), label=pkws.labels.rf_size, label_vofs=-0.04) # panel c : single axis ax_c = fig.add_subplot(gs[1, 1]) lineplots.lineplot(lineplots.rf_file_iterator('shift', lp_dists, lp_att_ells, (0, 4, 0), comp_ells=lp_comp_ells),
) ax_e = fig.add_subplot(gs[0, 0]) lineplots.lineplot(lineplots.gain_file_iterator(lp_dists, sgain_focl, (0, 4, 0)), ax_e, line_span=pkws.lineplot_span, rad=30, pal=pkws.pal_b, xlim=(0, 180), ylim=params.gain_lim, pkws=pkws) util.labels(ax_e, pkws.labels.unit_distance, pkws.labels.effective_gain, pkws=pkws) util.legend(fig, ax_e, pkws.labels.beta, pkws.pal_b, inset=pkws.legend_inset, inset_y=1.7, pkws=pkws) ax_e.set_yticks([1, params.gain_lim[1]]) ax_e.set_xticks([0, 150]) sns.despine(ax=ax_e, trim=True, offset=5) util.axis_expand(ax_e, L=-0.21, B=-0.08, R=0.1, T=0.05) # save plt.savefig(params.output, transparent=True)
base_e = util.panel_label(fig, gs[1, 1], "e") base_f = util.panel_label(fig, gs[1, 2], "f") base_g = util.panel_label(fig, gs[2, 0], "g") base_h = util.panel_label(fig, gs[2, 1], "h") base_h = util.panel_label(fig, gs[2, 2], "i") # ---------------- top row ---- # panel a ax_a = fig.add_subplot(gs[0, 0]) diagrams.rf_ellipses( ax_a, lp_pre_ells, lp_att_ells[3], grads_dist, grads_focl, (0,4,0), params.rf_diagram_units, loc = (56, 56), color_dist = '#000000', color_focl = '#d55c00') util.axis_expand(ax_a, L = 0.05, B = 0.1, R = 0.05, T = 0) util.labels(ax_a, pkws.labels.image_position.format('Horizontal'), pkws.labels.image_position.format('Vertical')) # panel b ax_b = fig.add_subplot(gs[0, 1]) quiver_mappable = quivers.quiverplot( qv_dist_ell, qv_focl_ell, qv_smooth_samp, ax_b, cmap = 'coolwarm', vrng = params.size_lim) util.axis_expand(ax_b, L = 0.1, B = 0.1, R = 0, T = 0) util.labels(ax_b, pkws.labels.image_position.format('Horizontal'), pkws.labels.image_position.format('Vertical')) util.colorbar( fig, ax_b, quiver_mappable, ticks = params.size_lim + (1,),