aboutsummaryrefslogtreecommitdiff
path: root/utils/plot-atmospheric-oscillations
diff options
context:
space:
mode:
Diffstat (limited to 'utils/plot-atmospheric-oscillations')
-rwxr-xr-xutils/plot-atmospheric-oscillations48
1 files changed, 6 insertions, 42 deletions
diff --git a/utils/plot-atmospheric-oscillations b/utils/plot-atmospheric-oscillations
index c24a776..2d2a0bf 100755
--- a/utils/plot-atmospheric-oscillations
+++ b/utils/plot-atmospheric-oscillations
@@ -11,52 +11,16 @@ import numpy as np
if __name__ == '__main__':
import argparse
from os.path import split, splitext
+ from sddm import setup_matplotlib
parser = argparse.ArgumentParser("script to plot atmospheric oscillations")
parser.add_argument("filenames", nargs='+', help="oscillation probability filenames")
parser.add_argument("--save", action="store_true", default=False, help="save plots")
args = parser.parse_args()
- if args.save:
- # default \textwidth for a fullpage article in Latex is 16.50764 cm.
- # You can figure this out by compiling the following TeX document:
- #
- # \documentclass{article}
- # \usepackage{fullpage}
- # \usepackage{layouts}
- # \begin{document}
- # textwidth in cm: \printinunitsof{cm}\prntlen{\textwidth}
- # \end{document}
+ setup_matplotlib(args.save)
- width = 16.50764
- width /= 2.54 # cm -> inches
- # According to this page:
- # http://www-personal.umich.edu/~jpboyd/eng403_chap2_tuftegospel.pdf,
- # Tufte suggests an aspect ratio of 1.5 - 1.6.
- height = width/1.5
- FIGSIZE = (width,height)
-
- import matplotlib.pyplot as plt
-
- font = {'family':'serif', 'serif': ['computer modern roman']}
- plt.rc('font',**font)
-
- plt.rc('text', usetex=True)
- else:
- # on retina screens, the default plots are way too small
- # by using Qt5 and setting QT_AUTO_SCREEN_SCALE_FACTOR=1
- # Qt5 will scale everything using the dpi in ~/.Xresources
- import matplotlib
- matplotlib.use("Qt5Agg")
-
- import matplotlib.pyplot as plt
-
- # Default figure size. Currently set to my monitor width and height so that
- # things are properly formatted
- FIGSIZE = (13.78,7.48)
-
- # Make the defalt font bigger
- plt.rc('font', size=22)
+ import matplotlib.pyplot as plt
for filename in args.filenames:
head, tail = split(filename)
@@ -74,7 +38,7 @@ if __name__ == '__main__':
levels = np.linspace(0,1,101)
- plt.figure(figsize=FIGSIZE)
+ plt.figure()
plt.contourf(ee,zz,pnue,levels=levels)
plt.gca().set_xscale('log')
plt.xlabel("Energy (GeV)")
@@ -86,7 +50,7 @@ if __name__ == '__main__':
plt.savefig("%s_nue.eps" % root)
else:
plt.title(r"Probability to oscillate to $\nu_e$")
- plt.figure(figsize=FIGSIZE)
+ plt.figure()
plt.contourf(ee,zz,pnum,levels=levels)
plt.gca().set_xscale('log')
plt.xlabel("Energy (GeV)")
@@ -98,7 +62,7 @@ if __name__ == '__main__':
plt.savefig("%s_num.eps" % root)
else:
plt.title(r"Probability to oscillate to $\nu_\mu$")
- plt.figure(figsize=FIGSIZE)
+ plt.figure()
plt.contourf(ee,zz,pnut,levels=levels)
plt.gca().set_xscale('log')
plt.xlabel("Energy (GeV)")