Exemplo n.º 1
0
    for ns, this_simname in enumerate(sim_list):
        Pearson_rand = []
        Pearson_sim = []
        alpha_rand = []
        alpha_sim = []
        if ns == 0:
            lab = sim_list[ns]
        else:
            lab = None
        Pearson_rand += (spheres[this_simname].pearson_randos)
        Pearson_sim += (atlist[this_simname].pearson_t[0])
        alpha_rand += (spheres[this_simname].alpha_randos)
        alpha_sim += (atlist[this_simname].alpha_t[0])

        plt.clf()
        fig, ax, ax_alpha, ax_r = means_etc.three_way_bean()
        ax_r.hist(Pearson_sim,
                  histtype='step',
                  color='r',
                  linestyle='-',
                  density=True,
                  orientation='horizontal')
        ax_r.hist(Pearson_rand,
                  histtype='step',
                  color='k',
                  linestyle='-',
                  density=True,
                  label=lab,
                  orientation='horizontal')
        ax.scatter(alpha_sim,
                   Pearson_sim,
Exemplo n.º 2
0
'''
three way plots to see how alpha 1 vs alpha 2 relate...
'''
from starter2 import *
import means_etc

figa,axa,axtop,axright = means_etc.three_way_bean()
axa.scatter( NumberOfOverlap, Fraction,c='k')  #I don't think we need this 'b'
axa.scatter( NumberOfOverlap,Max ,c='r')

axtop.hist( NumberOfOverlap, bins=bins_n, histtype='step',color='k')
axright.hist( Fraction, bins=bins_f, histtype='step',color='k',orientation='horizontal')
axright.hist( Max, bins=bins_f, histtype='step',color='r',orientation='horizontal')

#QUESTION: what was the purpose of plotting MAX here?


if 1:
    axbonk(axa,xlabel=r'$N_{\rm{overlap}}$', ylabel='Overlap Fraction')
    axa.set_xlim([-0.1,nmax+0.1])
    axbonk(axtop,xlabel='',ylabel=r'$N$')
    axbonk(axright,xlabel=r'$N$',ylabel='')
    axright.set_ylim( axa.get_ylim())
    axtop.set_xlim( axa.get_xlim())
    axtop.set_xticks([])
    axright.set_yticks([])

Exemplo n.º 3
0
        return np.log10(arr)
    def log_or_notv(arr):
        return np.log10(arr)/2

dlim = [dbins.min(), dbins.max()]
vlim = [vbins.min(), vbins.max()]
import colors
if 1:
    if 1:
        c1 = colors.color['u401']
        c2 = colors.color['u402']
        c3 = colors.color['u403']
        l1 = 'sim1'
        l2 = 'sim2'
        l3 = 'sim3'
        ax, ax_den_hist,ax_vel_hist=means_etc.three_way_bean() 
        ok = slice(None)
        ok1 = m1.npart > 1
        ok2 = m2.npart > 1
        ok3 = m3.npart > 1
        ax.scatter(log_or_not(m1.dmeans[ok1]),log_or_notv(m1.variance[ok1]),c=c1,label=l1, s=0.1)
        ax.scatter(log_or_not(m2.dmeans[ok2]),log_or_notv(m2.variance[ok2]),c=c2,label=l2, s=0.1)
        ax.scatter(log_or_not(m3.dmeans[ok3]),log_or_notv(m3.variance[ok3]),c=c3,label=l3, s=0.1)

        r1 = ax_den_hist.hist(log_or_not(m1.dmeans[ok1]), histtype='step',color=c1,label=l1,bins=dbins)
        r2 = ax_den_hist.hist(log_or_not(m2.dmeans[ok2]), histtype='step',color=c2,label=l2,bins=dbins)
        r3 = ax_den_hist.hist(log_or_not(m3.dmeans[ok3]), histtype='step',color=c3,label=l3,bins=dbins)

        v1 = ax_vel_hist.hist(log_or_notv(m1.variance[ok1]), histtype='step', orientation='horizontal',color=c1,bins=vbins)
        v2 = ax_vel_hist.hist(log_or_notv(m2.variance[ok2]), histtype='step', orientation='horizontal',color=c2,bins=vbins)
        v3 = ax_vel_hist.hist(log_or_notv(m3.variance[ok3]), histtype='step', orientation='horizontal',color=c3,bins=vbins)
Exemplo n.º 4
0
            if 1: # FOR ONE FRAME PER TIME; SINGLE PANEL 
                xlims = 0.4,1.8
                ylims = 0.0,5.0
                for i in range(len(axplts)):
                    if 1:
                        if nt == 0:
                            color = 'r'
                        if nt == 1:
                            color = 'b'
                        if nt == 2:
                            color = 'g'

                        the_bins = np.linspace(-10,10)
                        if ncore == 0:
                            figs[i],axplts[i],axtop[i],axright[i] = met.three_way_bean()
                        axplts[i].scatter(this_alphaS[i],this_alphaP[i],c=color)
                        axtop[i].hist(this_alphaS[i], bins=the_bins, histtype='step',color='k')
                        axright[i].hist(this_alphaP[i], bins=the_bins, histtype='step',color='k',orientation='horizontal')

                        outname_frame='AlphaSP_%s_%d'%(simnames[nt],i)
                        #axplts[i].scatter(this_alphaS[i],this_alphaP[i],c=color,marker='*')
                        magfield_density_tool.labelled(axplts[i],xscale=None,yscale=None,xlabel='Sum',ylabel='Product',\
                                                       title=None, xlim=None, ylim=None) #xlims,ylim=ylims)

                    if 0:
                        axplts[i].scatter(this_rho[i],this_field[i],c='g',marker='*')
                        axplts[i].scatter(this_rho[i],the_zz[i],c='g',alpha=0.2)
                        magfield_density_tool.labelled(axplts[i],xscale=None,yscale=None,xlabel=r'$\rho$',ylabel=r'$log(B/ \rho)$',\
                                                       title=None, xlim=None,ylim=None)
                        outname_frame='Scatter_LogBRhovsRho_%s_%d'%(simnames[nt],i)