-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot_utils.py
More file actions
76 lines (62 loc) · 2.32 KB
/
plot_utils.py
File metadata and controls
76 lines (62 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""
This sets some default plot preferences.
Figures made after calling this script will match those in the paper.
"""
import matplotlib.pyplot as plt
# Manual entry of color dict
lc_color_dict = {}
for surv in ['ztf','ps','sdss']:
lc_color_dict['g.'+surv] = 'g'
lc_color_dict['r.'+surv] = 'r'
lc_color_dict['i.'+surv] = 'brown'
lc_color_dict['W1.wise'] = 'goldenrod'
lc_color_dict['W2.wise'] = 'saddlebrown'
lc_color_dict['UVW2.uvot'] = 'violet'
lc_color_dict['UVM2.uvot'] = 'magenta'
lc_color_dict['UVW1.uvot'] = 'fuchsia'
lc_color_dict['U.uvot'] = 'darkblue'
lc_color_dict['u.sdss'] = 'darkblue'
lc_color_dict['F125LP'] = 'darkviolet'
lc_color_dict['F150LP'] = 'darkviolet'
lc_color_dict['F225W'] = 'magenta'
lc_color_dict['FUV'] = 'darkviolet'
lc_color_dict['NUV'] = 'magenta'
lc_color_dict['B.uvot'] = 'lightblue'
lc_color_dict['V.uvot'] = 'orange'
lc_color_dict['c.atlas'] = 'cyan'
lc_color_dict['o.atlas'] = 'orange'
marker_dict = {key:'o' for key in lc_color_dict}
marker_dict['UVW1.uvot'] = 's'
marker_dict['UVM2.uvot'] = 's'
marker_dict['UVW2.uvot'] = 's'
marker_dict['r.ztf'] = 's'
marker_dict['W1.wise'] = '*'
marker_dict['W2.wise'] = '*'
marker_dict['F125LP'] = '*'
marker_dict['F150LP'] = 'd'
marker_dict['F225W'] = '*'
def format_plots_like_paper():
""" Makes the figures have (almost) the same formatting as the paper. """
plt.rc('text', usetex=True) # switch this to False to match the light curve plots
plt.rc('font', family='serif') # switch this to Times to match the light curve plots
plt.rcParams['xtick.labelsize'] = 18
plt.rcParams['ytick.labelsize'] = 18
plt.rcParams['font.size'] = 20
plt.rcParams['legend.framealpha'] = 1
plt.rcParams['legend.edgecolor'] = 'k'
plt.rcParams['lines.linewidth'] = 2
plt.rcParams['figure.figsize'] = [12, 9]
plt.rcParams['ytick.right'] = True
plt.rcParams['xtick.top'] = True
plt.rcParams['ytick.minor.visible'] = True
plt.rcParams['xtick.minor.visible'] = True
plt.rcParams['ytick.direction'] = 'in'
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.major.size'] = 10
plt.rcParams['ytick.major.width'] = 1
plt.rcParams['ytick.minor.size'] = 4
plt.rcParams['xtick.major.size'] = 10
plt.rcParams['xtick.major.width'] = 1
plt.rcParams['xtick.minor.size'] = 4
plt.rcParams['savefig.format'] = 'pdf'
plt.rcParams['savefig.bbox'] = 'tight'