-
Notifications
You must be signed in to change notification settings - Fork 0
/
paper_plotpanels.py
71 lines (60 loc) · 2.43 KB
/
paper_plotpanels.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import numpy as np
import pylab as plt
from caterpillaranalysis import *
from caterpillarplot import *
from subradplugin import *
import haloutils
params = {'axes.labelsize': 22,
'text.fontsize': 22,
'legend.fontsize': 14,
'xtick.labelsize': 18,
'ytick.labelsize': 18,
'backend': 'ps',
'text.usetex': True}
plt.rcParams.update(params)
def old():
fig,axarr = plt.subplots(3,2,figsize=(16,24))
fig.subplots_adjust(hspace=.3,wspace=.25)
axNvmax = axarr[0,0]
axSHMF = axarr[0,1]
axLinMassAccr = axarr[1,0]
axSubMassFrac = axarr[1,1]
axSubRadProf = axarr[2,0]
axHostProf = axarr[2,1]
plugNvmax = NvmaxPlugin()
plugSHMF = SHMFPlugin()
plugLinMassAccr = LinearMassAccrPlugin()
plugSubMassFrac = SubhaloRadialSubmassFracPlugin()
plugSubRadProf = SubhaloRadialPlugin()
plugHostProf = ProfilePlugin()
lx=14; lw=2
paper_stackplot(lx,plugNvmax,ax=axNvmax,lw=lw)
paper_stackplot(lx,plugSHMF,ax=axSHMF,lw=lw)
paper_stackplot(lx,plugLinMassAccr,ax=axLinMassAccr,lw=lw)
paper_stackplot(lx,plugSubMassFrac,ax=axSubMassFrac,lw=lw)
paper_stackplot(lx,plugSubRadProf,ax=axSubRadProf,lw=lw)
paper_stackplot(lx,plugHostProf,ax=axHostProf)
colordict = haloutils.get_colors_for_halos()
labeldict = haloutils.hid2name
haloids = get_haloidlist(1)
colors = [colordict[hid] for hid in haloids]
labels = [labeldict[hid] for hid in haloids]
axNvmax.legend(axNvmax.lines,labels,loc='lower left',ncol=2,frameon=False) # ,fontsize='xx-small'
plt.savefig('paper_panels.png')
plt.savefig('paper_panels.eps')
plt.show()
if __name__=="__main__":
plugNvmax = NvmaxPlugin()
plugSHMF = SHMFPlugin()
plugLinMassAccr = LinearMassAccrPlugin()
plugSubMassFrac = SubhaloRadialSubmassFracPlugin()
plugSubRadProf = SubhaloRadialPlugin()
plugHostProf = ProfilePlugin()
lx=14; lw=3; ext='.png'
paper_stackplot(lx,plugNvmax,lw=lw,figfilename='p_Nvmax'+ext,legendloc='lower left')
paper_stackplot(lx,plugSHMF,lw=lw,figfilename='p_SHMF'+ext,legendloc='upper right')
#paper_stackplot(lx,plugLinMassAccr,lw=lw)
paper_stackplot(lx,plugSubMassFrac,lw=lw,figfilename='p_SubRadMassFrac'+ext,legendloc='upper left')
paper_stackplot(lx,plugSubRadProf,lw=lw,figfilename='p_SubRadNum'+ext,legendloc='lower left')
paper_stackplot(lx,plugHostProf,figfilename='p_HostProf'+ext)
plt.close('all')