In [18]:
import matplotlib
matplotlib.use('nbagg')
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
## for Palatino and other serif fonts use:
#rc('font',**{'family':'serif','serif':['Palatino']})
rc('text', usetex=True)
#LaTeX
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
In [19]:
df6 = pd.read_table("1.omb", skiprows=5,header = None, sep=" ")
df6.drop(df6.columns[[2]],axis=1, inplace=True)
df7 = pd.read_table("2.omb", skiprows=5,header = None, sep=" ")
df7.drop(df7.columns[[2]],axis=1, inplace=True)
df8 = pd.read_table("3.omb", skiprows=5,header = None, sep=" ")
df8.drop(df8.columns[[2]],axis=1, inplace=True)
df9 = pd.read_table("4.omb", skiprows=5,header = None, sep=" ")
df9.drop(df9.columns[[2]],axis=1, inplace=True)
df6.columns = ['a', 'b']
df7.columns = ['a', 'b']
df8.columns = ['a', 'b']
df9.columns = ['a', 'b']
plt.loglog(df6["a"],df6["b"],label=r'$\Omega_b*h^2 = 0.0215$')
plt.loglog(df7["a"],df7["b"],label=r'$\Omega_b*h^2 = 0.0200$')
plt.loglog(df8["a"],df8["b"],label=r'$\Omega_b*h^2 = 0.0220$')
plt.loglog(df9["a"],df9["b"],label=r'$\Omega_b*h^2 = 0.0230$')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)$')
plt.legend()
Out[19]:
In [20]:
plt.show()
In [21]:
df6 = pd.read_table("1.omm", skiprows=5,header = None, sep=" ")
df6.drop(df6.columns[[2]],axis=1, inplace=True)
df7 = pd.read_table("2.omm", skiprows=5,header = None, sep=" ")
df7.drop(df7.columns[[2]],axis=1, inplace=True)
df8 = pd.read_table("3.omm", skiprows=5,header = None, sep=" ")
df8.drop(df8.columns[[2]],axis=1, inplace=True)
df9 = pd.read_table("4.omm", skiprows=5,header = None, sep=" ")
df9.drop(df9.columns[[2]],axis=1, inplace=True)
df6.columns = ['a', 'b']
df7.columns = ['a', 'b']
df8.columns = ['a', 'b']
df9.columns = ['a', 'b']
plt.loglog(df6["a"],df6["b"],label=r'$\Omega_m*h^2 = 0.120$')
plt.loglog(df7["a"],df7["b"],label=r'$\Omega_m*h^2 = 0.130$')
plt.loglog(df8["a"],df8["b"],label=r'$\Omega_m*h^2 = 0.140$')
plt.loglog(df9["a"],df9["b"],label=r'$\Omega_m*h^2 = 0.150$')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)$')
plt.legend()
Out[21]:
In [22]:
plt.show()
In [23]:
df6 = pd.read_table("1.ns", skiprows=5,header = None, sep=" ")
df6.drop(df6.columns[[2]],axis=1, inplace=True)
df7 = pd.read_table("2.ns", skiprows=5,header = None, sep=" ")
df7.drop(df7.columns[[2]],axis=1, inplace=True)
df8 = pd.read_table("3.ns", skiprows=5,header = None, sep=" ")
df8.drop(df8.columns[[2]],axis=1, inplace=True)
df9 = pd.read_table("4.ns", skiprows=5,header = None, sep=" ")
df9.drop(df9.columns[[2]],axis=1, inplace=True)
df6.columns = ['a', 'b']
df7.columns = ['a', 'b']
df8.columns = ['a', 'b']
df9.columns = ['a', 'b']
plt.loglog(df6["a"],df6["b"],label=r'$n_s = 0.85$')
plt.loglog(df7["a"],df7["b"],label=r'$n_s = 0.90$')
plt.loglog(df8["a"],df8["b"],label=r'$n_s = 0.95$')
plt.loglog(df9["a"],df9["b"],label=r'$n_s = 1.05$')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)$')
plt.legend()
Out[23]:
In [24]:
plt.show()
In [25]:
plt.loglog(df6["a"],df6["b"]/df6["b"],label=r'$n_s = 0.85$')
plt.loglog(df7["a"],df7["b"]/df6["b"],label=r'$n_s = 0.90$')
plt.loglog(df8["a"],df8["b"]/df6["b"],label=r'$n_s = 0.95$')
plt.loglog(df9["a"],df9["b"]/df6["b"],label=r'$n_s = 1.05$')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)/P(k)_{base}$')
plt.legend()
Out[25]:
In [26]:
plt.show()