ax[1].plot(r_active_el[0, :], r_active_el[1, :], color='blue') ax[1].plot(miss_el[0, :], miss_el[1, :], color='k') ax_min = np.min(ax[0].get_xlim() + ax[0].get_ylim()) ax_max = np.max(ax[0].get_xlim() + ax[0].get_ylim()) ax[0].set_xlim((ax_min, ax_max)) ax[0].set_ylim((ax_min, ax_max)) ax[1].set_xlim((ax_min, ax_max)) ax[1].set_ylim((ax_min, ax_max)) #ax[0].set_xlim((-5, 7)) #ax[0].set_ylim((4, 14)) #ax[1].set_xlim((-5, 7)) #ax[1].set_ylim((4, 14)) ax[0].set_xlabel('Decoding Axis') ax[1].set_xlabel('Decoding Axis') ax[0].set_ylabel('Correlated Variability Axis') ax[1].set_ylabel('Correlated Variability Axis') ax[0].set_title("Passive") ax[1].set_title("Active") ax[0].set_aspect(cplt.get_square_asp(ax[0])) ax[1].set_aspect(cplt.get_square_asp(ax[1])) f.tight_layout() f.savefig(fn) plt.show()
rsc_df = ld.load_rsc('tar_rsc_0_0,2') rsc_df_site = rsc_df.groupby(by='site').mean() f, ax = plt.subplots(1, 1, figsize=(8, 6)) ax.bar([0, 1, 2], [ rsc_df_site['act_rsc'].mean(), rsc_df_site['passBig_rsc'].mean(), rsc_df_site['passSmall_rsc'].mean() ], edgecolor='k', color='lightgrey', lw=2) for s in rsc_df_site.index: vals = rsc_df_site.loc[s][['act_rsc', 'passBig_rsc', 'passSmall_rsc']] ax.plot([0, 1, 2], vals, 'o-', color='k') ax.set_xticks([0, 1, 2]) ax.set_xticklabels( ['Active', 'Pupil-matched \n passive', 'Small pupil \n passive'], rotation=45) ax.set_ylabel('Noise Correlation') ax.set_aspect(cplt.get_square_asp(ax)) f.tight_layout() f.savefig(fn) plt.show()
& (ap_df.index.isin(rr_idx))].groupby(by='site').mean() ax[0, 0].scatter(rt_pb_bysite[metric], rt_active_bysite[metric], color='k', edgecolor='white') ax[0, 0].scatter(rt_pb_bysite[metric].loc['TAR010c'], rt_active_bysite[metric].loc['TAR010c'], color='r', edgecolor='white') ax[0, 0].plot([vmin, vmax], [vmin, vmax], 'k--') ax[0, 0].set_xlabel('Big Passive') ax[0, 0].set_ylabel('Active') ax[0, 0].set_ylim((0, ylim)) ax[0, 0].set_xlim((0, xlim)) ax[0, 0].set_aspect(cplt.get_square_asp(ax[0, 0])) ax[1, 0].scatter(rr_pb_bysite[metric], rr_active_bysite[metric], color='k', edgecolor='white') ax[1, 0].scatter(rr_pb_bysite[metric].loc['TAR010c'], rr_active_bysite[metric].loc['TAR010c'], color='r', edgecolor='white') ax[1, 0].plot([vmin, vmax], [vmin, vmax], 'k--') ax[1, 0].set_xlabel('Big Passive') ax[1, 0].set_ylabel('Active') ax[1, 0].set_ylim((0, ylim)) ax[1, 0].set_xlim((0, xlim)) ax[1, 0].set_aspect(cplt.get_square_asp(ax[1, 0]))
delta.spines['bottom'].set_color(color.SIGNAL) delta.xaxis.label.set_color(color.SIGNAL) delta.tick_params(axis='x', colors=color.SIGNAL) delta.spines['left'].set_color(color.COSTHETA) delta.yaxis.label.set_color(color.COSTHETA) delta.tick_params(axis='y', colors=color.COSTHETA) delta.set_title(r"$\Delta d'^2$") # plot schematic sch.plot(Ael[0], Ael[1], color='tab:blue', lw=2) sch.plot(Bel[0], Bel[1], color='tab:orange', lw=2) sch.axvline(0, linestyle='--', color='lightgrey', zorder=-1) sch.axhline(0, linestyle='--', color='lightgrey', zorder=-1) sch.set_xlabel(r"$dDR_1 (\Delta \mathbf{\mu})$") sch.set_ylabel(r"$dDR_2$") sch.set_aspect(cplt.get_square_asp(sch)) # plot regression palette = { 'full': 'lightgrey', 'upc1_mean': 'r', 'upc1_diff': 'r', 'udU_mag_test': color.SIGNAL, 'unoiseAlign': color.COSTHETA } r2a = r2_all[[k for k in r2_all if (k == 'full') | (k.startswith('u'))]] sns.boxplot(x='variable', y='value', data=r2a.melt(), palette=palette, width=0.3,