-
Notifications
You must be signed in to change notification settings - Fork 0
/
omega_m0.py
86 lines (66 loc) · 2.88 KB
/
omega_m0.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import numpy as np
import matplotlib.pylab as pylab
import matplotlib.pyplot as plt
import scipy as sp
from src.lscdm import *
from src.lcdm import *
# ==================== NUMERICAL ANALYSIS ====================
z_dag_vals = np.arange(1.50, 4.51, 0.01)
Om0_lcdm = Om0_finder_LCDM()
Om0_lscdm = np.array([Om0_finder_LsCDM(z_dag_i) for z_dag_i in z_dag_vals])
z_ta = 2
a_ta = 1 / (1 + z_ta)
y_dag_points = np.array([0.60, 0.70, 0.80, 1.01, 1.05, 1.08])
z_dag_points = ((1 + z_ta) / y_dag_points) - 1
Om0_points = np.array([Om0_finder_LsCDM(z_dag_i) for z_dag_i in z_dag_points])
# ==================== PLOT ====================
# LaTeX rendering text fonts
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
# Adjusting the size of the figure
params = {'legend.fontsize': '27',
'axes.labelsize': '44',
'figure.figsize': (15, 10),
'xtick.labelsize': '44',
'ytick.labelsize': '44'}
pylab.rcParams.update(params)
fig, ax0 = plt.subplots()
ax0.axhline(y=Om0_lcdm, color='#000000', ls=(0, (5, 1)),
lw=3.5, label=r'$\Lambda$CDM')
ax0.plot(z_dag_vals, Om0_lscdm, color='#000085', ls='-',
alpha=0.3, lw=3.5, label=r'$\Lambda_{\rm s}$CDM')
ax0.scatter(z_dag_points[0], Om0_points[0], facecolor='#FFA500', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=0.60$')
ax0.scatter(z_dag_points[1], Om0_points[1], facecolor='#Ff0000', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=0.70$')
ax0.scatter(z_dag_points[2], Om0_points[2], facecolor='#800000', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=0.80$')
ax0.scatter(z_dag_points[3], Om0_points[3], facecolor='#000080', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=1.01$')
ax0.scatter(z_dag_points[4], Om0_points[4], facecolor='#0000ff', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=1.05$')
ax0.scatter(z_dag_points[5], Om0_points[5], facecolor='#00ffff', edgecolors='black',
linewidth=1.0, s=150, label=r'$y_{\dagger}=1.08$')
# Setting labels
ax0.set_xlabel(r'$z_{\dagger}$')
ax0.set_ylabel(r'$\Omega_{\rm m0}$')
# Setting limits
ax0.set_xlim(1.50, 4.50)
ax0.set_ylim(0.255, 0.315)
# Tick options
# Set the desired ticks on the x/y-axis
ax0.set_xticks([1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5])
ax0.set_yticks([0.255, 0.265, 0.275, 0.285, 0.295, 0.305, 0.315])
ax0.xaxis.set_ticks_position('both')
ax0.yaxis.set_ticks_position('both')
ax0.xaxis.set_tick_params(which='major', width=1.5, size=13.0, direction='in')
ax0.xaxis.set_tick_params(which='minor', width=1.0, size=6.50, direction='in')
ax0.yaxis.set_tick_params(which='major', width=1.5, size=13.0, direction='in')
ax0.yaxis.set_tick_params(which='minor', width=1.0, size=6.50, direction='in')
ax0.minorticks_on()
# Other settings
ax0.legend()
plt.tight_layout()
# Saving the figure
plt.savefig(r'log\omegam0.pdf', format='pdf', dpi=400)
plt.show()