Skip to content

Commit e1e5289

Browse files
refactor: increase font sizes of initial condition plots
also change colours
1 parent 2ba671b commit e1e5289

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

scripts_for_plotting/initial_conditions.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@
5454
is_precip = True
5555
precip_rolling_window = 100 # [number of timesteps, 1 timestep~1.25s]
5656

57+
# %% font sizes for beautifying plots
58+
SMALL_SIZE = 15
59+
MEDIUM_SIZE = 16
60+
BIG_SIZE = 18
61+
62+
plt.rc("font", size=SMALL_SIZE) # controls default text sizes
63+
plt.rc("axes", titlesize=BIG_SIZE) # fontsize of the axes title
64+
plt.rc("axes", labelsize=BIG_SIZE) # fontsize of the x and y labels
65+
plt.rc("xtick", labelsize=SMALL_SIZE) # fontsize of the tick labels
66+
plt.rc("ytick", labelsize=SMALL_SIZE) # fontsize of the tick labels
67+
plt.rc("legend", fontsize=MEDIUM_SIZE) # legend fontsize
68+
plt.rc("figure", titlesize=BIG_SIZE) # fontsize of the figure title
69+
5770
# %% Check directories containing datasets exist
5871
assert args.cleo_path2build.is_dir(), f"cleo_path2build: {args.cleo_path2build}"
5972
assert args.pysdm_path2build.is_dir(), f"pysdm_path2build: {args.pysdm_path2build}"
@@ -165,7 +178,7 @@ def plot_row(axs, cds_var, pds_var, color):
165178

166179

167180
# %% nice plot of intitial conditions
168-
fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(8.5, 5.5))
181+
fig, axes = plt.subplots(nrows=2, ncols=3, figsize=(10, 7))
169182

170183

171184
def at_time(ds, var, time2plot):
@@ -212,7 +225,7 @@ def at_time(ds, var, time2plot):
212225
)
213226
axes[0, 2].set_xlabel("time / s")
214227
axes[0, 2].set_xlim([0.0, 1000])
215-
axes[0, 2].legend()
228+
axes[0, 2].legend(loc=(0.55, 0.5))
216229
axes[0, 2].set_ylabel("$w$ / m s$^{-1}$")
217230

218231
axes[0, 0].set_ylabel("height / m")
@@ -246,7 +259,7 @@ def at_time(ds, var, time2plot):
246259

247260
reload(distribs)
248261

249-
fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(9, 5), sharex=True)
262+
fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(10.5, 7), sharex=True)
250263

251264
t2plts = [0.0]
252265
nbins = 40
@@ -260,9 +273,9 @@ def at_time(ds, var, time2plot):
260273
).values
261274

262275
alpha_color = {
263-
0.0: "orange",
264-
0.5: "violet",
265-
1.0: "turquoise",
276+
0.0: "lightseagreen",
277+
0.5: "mediumblue",
278+
1.0: "maroon",
266279
}
267280
for alpha, csds in alpha_csds.items():
268281
plot_kwargs = {"c": alpha_color[alpha], "label": f"\u03B1 = {alpha}"}
@@ -312,7 +325,7 @@ def at_time(ds, var, time2plot):
312325

313326
for ax in axs:
314327
ax.spines[["right", "top"]].set_visible(False)
315-
axs[1].legend(loc="upper right")
328+
axs[0].legend(loc=(0.05, 0.98))
316329

317330
fig.tight_layout()
318331

0 commit comments

Comments
 (0)