ax_5.bar(np.arange(len(all_id)), exp3_econ_part, color='k', alpha=0.2) ax_5.axhline(exp3_econ_mean, color='black', lw=0.5, linestyle='--') ax_5.set_ylim([0.5, 1]) ax_5.set_title('Gabor-bandit task') ax_5.set_ylabel('Economic-choice\nperformance') ax_5.set_xlabel('Participant') # Adjust figure space plt.subplots_adjust(top=0.95, bottom=0.1, left=0.10, right=0.9, hspace=1, wspace=0.35) sns.despine() # -------------- # 3. Save figure # -------------- # Label letters texts = ['a', 'b', 'd', 'c', 'e'] # Add labels label_subplots(f, texts, x_offset=0.06, y_offset=0.015) savename = 'gb_figures/gb_sm_figure_2.pdf' plt.savefig(savename) plt.show()
# Average probability with which choices can be predicted # -------------------------------------------------------- choice_pred_prob_A0 = np.mean(np.exp(-1 * part_params['A0_llh'] / 300)) choice_pred_prob_A3 = np.mean(np.exp(-1 * part_params['A3_llh'] / 300)) choice_pred_prob_A6 = np.mean(np.exp(-1 * part_params['A6_llh'] / 300)) print('Average prediction accuracy A0: %f' % choice_pred_prob_A0) print('Average prediction accuracy A3: %f' % choice_pred_prob_A3) print('Average prediction accuracy A6: %f' % choice_pred_prob_A6) # ------------------------------------- # 7. Add subplot labels and save figure # ------------------------------------- # Despine and delete unnecessary axes of broken axes plot sns.despine() ax_0.axs[0].spines['bottom'].set_visible(False) ax_0.big_ax.spines['left'].set_visible(False) # Label letters texts = [' a', ' ', ' ', 'b', 'c', 'd', 'e'] # Add labels label_subplots(f, texts) # Save figure savename = 'gb_figures/gb_figure_3.pdf' plt.savefig(savename, transparent=True) plt.show()
# Plot frequency target patch left ax = plt.Subplot(f, gs00[0, 3]) f.add_subplot(ax) ax.set_ylabel('Frequency red fractal up') ax.tick_params(axis='x', which='both', bottom=False, top=False, labelbottom=False) ax.bar(0, left, color='k') # ------------------------------------- # 4. Add subplot labels and save figure # ------------------------------------- # Label letters texts = ['a', 'b ', 'c ', 'd'] # Add labels label_subplots(f, texts, x_offset=0.075) # Delete unnecessary axes sns.despine() # Save plot savename = '/Users/rasmus/Dropbox/gabor_bandit/code/gaborbandit_analysis/gb_figures/gb_sm_figure_1.pdf' plt.savefig(savename, dpi=400) # Show plot plt.show()