-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathformats.py
126 lines (112 loc) · 6.54 KB
/
formats.py
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
from grapheval.nodefigure import NodeFigureFormat
import proplot as pplt
pplt.rc['font.family'] = 'serif'
#pplt.rc['suptitle.pad'] = 18.0
momentumhist = NodeFigureFormat(
subplots=None,
fig_format={'xscale': 'log', 'yscale': 'log', 'ylabel':'Particle number density', 'yformatter': pplt.SciFormatter(), 'xformatter': pplt.SciFormatter(), 'xlabel': '$p/p_\\textrm{inj}$'},
legend_kw={'loc': 'r', 'ncols': 1}
)
doublehist = NodeFigureFormat(
subplots={'ncols': 2},
fig_format={'yscale': 'log', 'ylabel':'Particle number density', 'yformatter': 'log'}, #yformatter was pplt.SciFormatter() but produced 1x10^2 instead of just 10^2
axs_format=[
{'xlabel': '$x$'},
{'xscale': 'log', 'xformatter': pplt.SciFormatter(), 'xlabel': '$p/p_\\textrm{inj}$'}
],
legends_kw={1: {'loc': 'ur', 'ncols': 1}}
)
doublehist2 = NodeFigureFormat(
subplots={'ncols': 2},
fig_format={'yscale': 'log', 'ylabel':'Particle number density', 'yformatter': 'log'}, #yformatter was pplt.SciFormatter() but produced 1x10^2 instead of just 10^2
axs_format=[
{'xlabel': '$x$'},
{'xscale': 'log', 'xformatter': 'log', 'xlabel': '$p/p_\\textrm{inj}$'}
]
)
doublehistand2d = NodeFigureFormat(
subplots={'ncols': 3},
fig_format={'yscale': 'log', 'yformatter': 'log'},
axs_format=[
{'xlabel': '$x$', 'ylabel':'Particle number density'},
{'xscale': 'log', 'xformatter': 'log', 'ylabel':'Particle number density', 'xlabel': '$p/p_\\textrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$y$'}
],
legends_kw={1: {'loc': 'ur', 'ncols': 1}}
)
doublehistand2d2 = NodeFigureFormat(
subplots={'array': [[1, 2], [3, 3], [3, 3]]},
fig_format={'yscale': 'log', 'yformatter': 'log'},
axs_format=[
{'xlabel': '$x$ (Shock at $x=0$)', 'ylabel':'Particle number density'},
{'xscale': 'log', 'xformatter': 'log', 'xlabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'}
],
)
doublehistand2dmany = NodeFigureFormat(
subplots={'array': [[1, 2], [3, 4], [5, 6]]},
fig_format={'yscale': 'log', 'yformatter': 'log'},
axs_format=[
{'xlabel': '$x$ (Shock at $x=0$)', 'ylabel':'Particle number density'},
{'xscale': 'log', 'xformatter': 'log', 'xlabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'}
],
)
contours4 = NodeFigureFormat(
subplots={'array': [[1, 2], [3, 4]]},
fig_format={'yscale': 'log', 'yformatter': 'log'},
axs_format=[
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'},
{'xlabel' : '$x$', 'ylabel': '$p/p_\\mathrm{inj}$'}
],
)
doublehistSED = NodeFigureFormat(
subplots={'ncols' : 3},
fig_format={},
axs_format=[
{'yformatter': 'sci', 'xlabel': '$x$', 'yscale': 'log', 'ylabel':'Particle number density'},
{'yformatter': 'sci', 'xscale': 'log', 'xformatter': 'sci', 'xlabel': '$p/p_\\textrm{inj}$', 'yscale': 'log', 'ylabel':'Particle number density'},
{'yformatter': 'sci', 'xlabel': '$\\nu$ in Hz', 'xformatter': 'sci', 'xscale': 'log', 'ylabel': 'Flux $\\nu F_\\nu$ (a.u.)', 'yscale': 'log'}
],
legends_kw={1: {'loc': 'ur', 'ncols': 1}}
)
singlehistSED = NodeFigureFormat(
subplots={'ncols' : 2},
fig_format={},
axs_format=[
{'yformatter': 'log', 'xscale': 'log', 'xformatter': 'log', 'xlabel': '$p/p_\\textrm{inj}$', 'yscale': 'log', 'ylabel':'Particle number density'},
{'yformatter': 'log', 'xlabel': '$\\nu$ in Hz', 'xformatter': 'log', 'xscale': 'log', 'ylabel': 'Flux $\\nu F_\\nu$ (a.u.)', 'yscale': 'log'}
],
#legends_kw={0: {'loc': 'ur', 'ncols': 1}}
)
powerlaws = NodeFigureFormat(
subplots=None,
fig_format={'ylabel':'Power-law index $s$'},
axs_format=[
{'xlabel': ''},
],
legend_kw={}
)
histsandpowerlaw = NodeFigureFormat(
subplots={'ncols': 3},
axs_format=[
{'xlabel': '$x$', 'yscale': 'log', 'ylabel':'Particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()},
{'xscale': 'log', 'xlabel': '$p/p_\\textrm{inj}$', 'yscale': 'log', 'ylabel':'Particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()}
],
legends_kw={1: {'loc': 'ur', 'ncols': 1}}
)
histsandpowerlaw2 = NodeFigureFormat(
subplots={'array' : [[1, 3, 5], [2, 4, 5]]},
axs_format=[
{'xlabel': '$x$', 'yscale': 'log', 'ylabel':'particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()},
{'xlabel': '$x$', 'yscale': 'log', 'ylabel':'particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()},
{'xscale': 'log', 'xlabel': '$p/p_\\textrm{inj}$', 'yscale': 'log', 'ylabel':'particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()},
{'xscale': 'log', 'xlabel': '$p/p_\\textrm{inj}$', 'yscale': 'log', 'ylabel':'particle number density', 'xformatter': pplt.SciFormatter(), 'yformatter': pplt.SciFormatter()}
],
legends_kw={1: {'loc': 'ur', 'ncols': 1}}
)