Skip to content

Commit

Permalink
uniform styles across plots (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
zatkins2 authored Feb 24, 2025
1 parent a2aa58c commit c4c31af
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions project/ACT_DR6/python/mm_transfer_function/plot_all_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

d = so_dict.so_dict()
d.read_from_file(sys.argv[1])

planck_version = d["planck_version"]
matplotlib.rcParams["font.family"] = "serif"
matplotlib.rcParams["font.size"] = "18"

labelsize = 14
fontsize = 20

plot_dir = "plots/paper_plot"
pspy_utils.create_directory(plot_dir)
Expand All @@ -20,7 +20,7 @@

tf_dir = f"tf_estimator_{combin}_fg_sub"

plt.figure(figsize=(16, 8))
plt.figure(figsize=(12, 6), dpi=100)
colors = ["red", "orange", "green", "blue", "gray"]
arrays = ["pa5_f090", "pa6_f090", "pa5_f150", "pa6_f150", "pa4_f220"]

Expand All @@ -29,16 +29,17 @@
lb, tf, tferr = np.loadtxt(f"{tf_dir}/tf_estimator_dr6_{ar}.dat", unpack=True)
pa, freq = ar.split("_")

plt.errorbar(lb-10 +count*5, tf, tferr, fmt="o", color=col, label=f"{pa.upper} {freq}")
plt.errorbar(lb-10 +count*5, tf, tferr, fmt="o", color=col, label=f"{pa.upper()} {freq}")
plt.plot(lb, lb*0+1, "--", color="black", alpha=0.5)
count += 1

na, nb = combin.split("_")
plt.ylabel(r"$T_{\ell} = C_{\ell, \rm %s}^{\rm TT} / C_{\ell, \rm %s}^{\rm TT}$" % (na, nb), fontsize=25)
plt.xlabel(r"$\ell$", fontsize=25)
plt.ylabel(r"$T_{\ell} = C_{\ell, \rm %s}^{\rm TT} / C_{\ell, \rm %s}^{\rm TT}$" % (na, nb), fontsize=fontsize)
plt.xlabel(r"$\ell$", fontsize=fontsize)
plt.xlim(0, 1800)
plt.ylim(0.9, 1.05)
plt.legend()
plt.legend(fontsize=labelsize)
plt.tick_params(labelsize=labelsize)
plt.savefig(f"{plot_dir}/{tf_dir}_{planck_version}.pdf", bbox_inches="tight")
plt.clf()
plt.close()

0 comments on commit c4c31af

Please sign in to comment.