import mesa as ms import utils as u ms.set_nice_params() cb=u.colourblind p=ms.mesa_profile('/Volumes/jazz/work/data/iprocess/new_fs/f_study//pulse_profiles/M7.0Z0.0001_0.014_0.014_pp/LOGS',132982) fig, ax = subplots(2, figsize=(12,9.)) me=50 # Hide x ticks for all but bottom plot: fig.subplots_adjust(hspace=0.14,left=0.1,right=0.9) setp(ax[0].get_xticklabels(), visible=False) # Twin the x-axis twice to make independent y-axes. mytopaxes = [ax[0], ax[0].twinx(), ax[0].twinx()] # Make some space on the right side for the extra y-axis. fig.subplots_adjust(right=0.8) # Move the last y-axis spine over to the right by 12% of the width of the axes mytopaxes[-1].spines['right'].set_position(('axes', 1.12)) # To make the border of the right-most axis visible, we need to turn the frame # on. This hides the other plots, however, so we need to turn its fill off. mytopaxes[-1].set_frame_on(True) mytopaxes[-1].patch.set_visible(False) # now the same for the bottom graph: mybotaxes = [ax[1], ax[1].twinx(), ax[1].twinx()] fig.subplots_adjust(right=0.8) mybotaxes[-1].spines['right'].set_position(('axes', 1.12)) mybotaxes[-1].set_frame_on(True) mybotaxes[-1].patch.set_visible(False) # abundance profile in top left: axes(mytopaxes[0]) p.abu_profile(isos=['h1','he4','c12','n13','o16'],logy=True,colourblind=True) #xlim(1.26235,1.2624) xlim(1.26234,1.26245) ylim(-3,0.1) xlabel('') legend(loc='best',prop={'size':14},numpoints=1).draw_frame(False) ylabel('$\log\,X$') # temperature in top middle: axes(mytopaxes[1]) plot(p.get('mass'),p.get('temperature')/1.e7,label='$T$',linewidth=3.5,color='g',alpha=0.3,linestyle='--') ylabel('$T\,/\,10^7\,\mathrm{K}$') legend(loc=(0.02,0.58),prop={'size':14}).draw_frame(False) ylim(0,40) # density in top right: axes(mytopaxes[2]) plot(p.get('mass'),p.get('logRho'), label='$\\rho$',linewidth=1.,color='b',linestyle='--', marker='*',markevery=me) ylabel('$\log(\\rho\,/\,\mathrm{g\,cm}^{-3})$') legend(loc=(0.02,0.45),prop={'size':14}).draw_frame(False) ylim(-2.5,3) # entropy in bottom left: axes(mybotaxes[0]) plot(p.get('mass'),p.get('entropy'), label='$s$',color=cb(11),marker='o', mec='None',markevery=me) ylabel('$\mathrm{entropy\,per\,baryon}$') legend(loc=(0.02,0.85),prop={'size':14},numpoints=1).draw_frame(False) #xlim(1.26235,1.2624) xlim(1.26234,1.26245) ylim(12,36) xlabel('$\mathrm{Mass}\,/\,\mathrm{M}_\odot$') # eps_nuc in bottom middle: axes(mybotaxes[1]) plot(p.get('mass'),np.log10(p.get('eps_nuc')), label='$\epsilon_\mathrm{nuc}$',color=cb(5), marker='s',mec='None',markevery=me) ylabel('$\log(\epsilon_\mathrm{nuc}\,/\,\mathrm{erg\,g}^{-1}\,\mathrm{s}^{-1})$') legend(loc=(0.02,0.75),prop={'size':14},numpoints=1).draw_frame(False) ylim(10,16) # D coeff in top right: axes(mybotaxes[2]) plot(p.get('mass'),p.get('log_D_mix'), label='$D$',color='k') ylabel('$\log(D\,/\,\mathrm{cm}^2\,\mathrm{s}^{-1})$') legend(loc=(0.02,0.65),prop={'size':14},numpoints=1).draw_frame(False) ylim(5,18)