In [1]:
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 [2]:
df = pd.read_table("wmap7", skiprows=5,header = None, sep=" ")
df.drop(df.columns[[2]],axis=1, inplace=True)
df1 = pd.read_table("wmap9", skiprows=5,header = None, sep=" ")
df1.drop(df1.columns[[2]],axis=1, inplace=True)
df2 = pd.read_table("planck", skiprows=5,header = None, sep=" ")
df2.drop(df2.columns[[2]],axis=1, inplace=True)
In [3]:
df.columns = ['a', 'b']
df1.columns = ['a', 'b']
df2.columns = ['a', 'b']
In [4]:
plt.loglog(df["a"],df["b"],label=r'WMAP7')
plt.loglog(df1["a"],df1["b"],label=r'WMAP9')
plt.loglog(df2["a"],df2["b"],label=r'PLANCK')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)$')
plt.legend()
plt.show()
In [6]:
df3 = pd.read_table("wmap7h", skiprows=5,header = None, sep=" ")
df3.drop(df3.columns[[2]],axis=1, inplace=True)
df4 = pd.read_table("wmap9h", skiprows=5,header = None, sep=" ")
df4.drop(df4.columns[[2]],axis=1, inplace=True)
df5 = pd.read_table("planckh", skiprows=5,header = None, sep=" ")
df5.drop(df5.columns[[2]],axis=1, inplace=True)
In [7]:
df3.columns = ['a', 'b']
df4.columns = ['a', 'b']
df5.columns = ['a', 'b']
In [5]:
plt.loglog(df3["a"],df["b"],label=r'WMAP7')
plt.loglog(df4["a"],df1["b"],label=r'WMAP9')
plt.loglog(df5["a"],df2["b"],label=r'PLANCK')
plt.xlabel(r'$k$')
plt.ylabel(r'$P(k)$')
plt.legend()
plt.show()