# ex_cmbrtemp.ppl
#
# The code in this file is part of Pyxplot
# <http://www.pyxplot.org.uk>
#
# Copyright (C) 2006-2012 Dominic Ford <coders@pyxplot.org.uk>
#               2008-2012 Ross Church
#
# $Id: ex_cmbrtemp.ppl 1261 2012-07-11 21:38:05Z dcf21 $
#
# Pyxplot is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# You should have received a copy of the GNU General Public License along with
# Pyxplot; if not, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA  02110-1301, USA

# ----------------------------------------------------------------------------

# This script produces a figure for the Pyxplot Users' Guide

# Call common initialisation script
reset
title = "ex_cmbrtemp"
load "examples/fig_init.ppl"

# Main body of figure script
set nokey
set fontsize 1.5
set width 16

# BEGIN
h0 = 70
omega_m = 0.27
omega_l = 0.73
age = ast.Lcdm_age(h0,omega_m,omega_l)
set xrange [0.01*age:0.99*age]
set xtics (unit(1*Gyr),unit(4*Gyr),unit(7*Gyr),unit(10*Gyr),unit(13.6*Gyr))
set unit of time Gyr
set axis x2 linked x using ast.Lcdm_z(age-x,h0,omega_m,omega_l)
set xlabel "Time since Big Bang $t$"
set ylabel "CMBR Temperature $T$"
set x2label "Redshift $z$"
plot unit(2.73*K)*(1+x) ax x2y1
# END

# Call common cleanup script
load "examples/fig_end.ppl"

