diff --git a/plot_chi2.pdf b/plot_chi2.pdf index 42505b6..4b11009 100644 Binary files a/plot_chi2.pdf and b/plot_chi2.pdf differ diff --git a/plot_chi2.png b/plot_chi2.png index f8aa2c6..d71de54 100644 Binary files a/plot_chi2.png and b/plot_chi2.png differ diff --git a/plot_chi2.py b/plot_chi2.py index 0ce03a7..1dd06d1 100644 --- a/plot_chi2.py +++ b/plot_chi2.py @@ -142,15 +142,38 @@ if __name__ == '__main__': fig1, ax = plt.subplots(1,2) - plt.subplots_adjust(bottom=0.2, wspace=0.35, left=0.04, right = 0.97) + plt.subplots_adjust(bottom=0.2, wspace=0.35, left=0.1, right = 0.92) kwargs = {'cmap': 'turbo', 'extent': [frame2.columns[0], frame2.columns[-1], frame2.index[0], frame2.index[-1]]}#x_min - 0.5*dx, x_max + 0.5*dx, y_min - 0.5*dy, y_max + 0.5*dy #im = ax[0].imshow(np.abs(frame2), **kwargs, origin='lower') #clim = im.get_clim() #im.set_clim(0, clim[-1]) #embed() + + #cbar.set_label(nonlin_title(add_nonlin_title=' ['), + # rotation=90, + # labelpad=8) + #set_clim_same([im], mats=[np.abs(frame2)], lim_type='up', nr_clim='perc', clims='', percnr=99)#perc_model_full() + #plt.colorbar(pos, fraction=0.046)#, pad=0.04 + + ################################################### + # transfer + #embed() + #new_keys, frame0 = convert_csv_str_to_float(frame) + frame = frame.astype(complex) + ax[0].plot(frame.index, np.abs(frame['transfer']), color = 'black') + ax[0].set_xlabel(r'$f_{1}$') + ax[0].set_ylabel(r'$|\chi_{1}|$') + ax[0].set_xlim(0, frame.index[-1]) + ylim = ax[0].get_ylim() + ax[0].set_ylim(0, ylim[-1]) + + + + ################################################### + # matrix frame2.columns = frame2.index new_keys, stack_plot = convert_csv_str_to_float(frame2) - im = plt_RAM_perc(ax[0], 'perc', np.abs(stack_plot)) + im = plt_RAM_perc(ax[1], 'perc', np.abs(stack_plot)) set_clim_same([im], mats=[np.abs(stack_plot)], lim_type='up', @@ -161,36 +184,20 @@ if __name__ == '__main__': pos_rel = -0.12 #set_xlabel_arrow(ax[0], xpos=0.95, ypos=pos_rel) #set_ylabel_arrow(ax[0], xpos=pos_rel, ypos=0.95) - cbar, left, bottom, width, height = colorbar_outside(ax[0], + cbar, left, bottom, width, height = colorbar_outside(ax[1], im, add=5, width=0.01) - #cbar.set_label(nonlin_title(add_nonlin_title=' ['), - # rotation=90, - # labelpad=8) - #set_clim_same([im], mats=[np.abs(frame2)], lim_type='up', nr_clim='perc', clims='', percnr=99)#perc_model_full() - #plt.colorbar(pos, fraction=0.046)#, pad=0.04 - - ax[0].set_xlabel(r'$f_{1}$') - ax[0].set_ylabel(r'$f_{2}$') + ax[1].set_xlabel(r'$f_{1}$') + ax[1].set_ylabel(r'$f_{2}$') #ax[0].set_title(r'$|\chi_{2}(\omega_{1}, \omega_{2})|$' + ': ' + r'$\mu =$ ' + str(mu) + ', D = ' + str(D) + ', ' + r'$r_{0} =$ ' + str(round(r0,3)), pad = 10) - ax[0].set_xticks_delta(0.2) - ax[0].set_xticks_delta(0.2) - ax[0].set_xlim(frame2.columns[0]-0.01, frame2.columns[-1]) - ax[0].set_ylim(frame2.columns[0] - 0.01, frame2.columns[-1]) - cbar, left, bottom, width, height = colorbar_outside(ax[0], im, add=5, width=0.01) + ax[1].set_xticks_delta(0.2) + ax[1].set_xticks_delta(0.2) + ax[1].set_xlim(frame2.columns[0]-0.01, frame2.columns[-1]) + ax[1].set_ylim(frame2.columns[0] - 0.01, frame2.columns[-1]) + cbar, left, bottom, width, height = colorbar_outside(ax[1], im, add=5, width=0.01) cbar.set_label(r'$|\chi_{2}|$', rotation=90, labelpad=8) - #embed() - #new_keys, frame0 = convert_csv_str_to_float(frame) - frame = frame.astype(complex) - ax[1].plot(frame.index, np.abs(frame['transfer']), color = 'black') - ax[1].set_xlabel(r'$f_{1}$') - ax[1].set_ylabel(r'$|\chi_{1}|$') - ax[1].set_xlim(0, frame.index[-1]) - ylim = ax[1].get_ylim() - ax[1].set_ylim(0, ylim[-1]) - fig = plt.gcf() tag2(axes = ax, xoffs=[-0.5, -5.5], yoffs=1.7) # ax_ams[3],