Skip to content

Commit ed27e0b

Browse files
committed
Wave tweaks, up font size to 9
1 parent 1710936 commit ed27e0b

File tree

4 files changed

+41
-36
lines changed

4 files changed

+41
-36
lines changed

atmospheric_waves/plot_waves.py

+22-19
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
# Figures
6161
fig, ax = plt.subplots(nrows=2, sharex=True, figsize=(3.4, 2.8))
6262
fig_eig, ax_eig = plt.subplots(nrows=2, sharex=True, figsize=(3.4, 2.8))
63-
fig.subplots_adjust(left=0.11, bottom=0.12, right=0.97, top=0.97, hspace=0.06)
64-
fig_eig.subplots_adjust(left=0.11, bottom=0.12, right=0.97, top=0.97, hspace=0.06)
63+
fig.subplots_adjust(left=0.12, bottom=0.12, right=0.97, top=0.97, hspace=0.06)
64+
fig_eig.subplots_adjust(left=0.12, bottom=0.12, right=0.97, top=0.97, hspace=0.06)
6565

6666
# Loop over kx
6767
for i, k1 in enumerate(ks):
@@ -78,14 +78,17 @@
7878
acoustic = (np.abs(ω) > ω_upper[i])
7979

8080
# Plot frequencies
81-
ax[0].plot(k[acoustic], np.abs(ω[acoustic]), color=c_acoustic, **freq_props)
82-
ax[0].plot(k[f_mode], np.abs(ω[f_mode]), color=c_f_mode, **freq_props)
83-
ax[0].plot(k[gwaves], np.abs(ω[gwaves]), color=c_gravity, **freq_props)
8481
if i == 0:
82+
ax[0].plot(k[acoustic], np.abs(ω[acoustic]), color=c_acoustic, label='ac', **freq_props)
83+
ax[0].plot(k[f_mode], np.abs(ω[f_mode]), color=c_f_mode, label='f', **freq_props)
84+
ax[0].plot(k[gwaves], np.abs(ω[gwaves]), color=c_gravity, label='ac', **freq_props)
8585
ax[1].plot(k[gwaves], np.abs(1/ω[gwaves]), color=c_gravity, label='gw', **freq_props)
8686
ax[1].plot(k[f_mode], np.abs(1/ω[f_mode]), color=c_f_mode, label='f', **freq_props)
8787
ax[1].plot(k[acoustic], np.abs(1/ω[acoustic]), color=c_acoustic, label='ac', **freq_props)
8888
else:
89+
ax[0].plot(k[acoustic], np.abs(ω[acoustic]), color=c_acoustic, **freq_props)
90+
ax[0].plot(k[f_mode], np.abs(ω[f_mode]), color=c_f_mode, **freq_props)
91+
ax[0].plot(k[gwaves], np.abs(ω[gwaves]), color=c_gravity, **freq_props)
8992
ax[1].plot(k[acoustic], np.abs(1/ω[acoustic]), color=c_acoustic,**freq_props)
9093
ax[1].plot(k[f_mode], np.abs(1/ω[f_mode]), color=c_f_mode, **freq_props)
9194
ax[1].plot(k[gwaves], np.abs(1/ω[gwaves]), color=c_gravity, **freq_props)
@@ -104,7 +107,7 @@
104107
# Mode properties
105108
colors = ['C1', 'C2', 'C4', 'C5']
106109
marker = 'o'
107-
msc = 4
110+
msc = 6
108111
mec = "none"
109112
print(" ω/N, N/ω")
110113
mode_props = dict(marker=marker, mec=mec, markersize=msc, alpha=0.5, zorder=3)
@@ -126,8 +129,8 @@
126129

127130
# Frequency lines
128131
line_props = {'ls': 'solid', 'lw': 1, 'alpha': 0.5, 'zorder': 1}
129-
ax[0].plot(ks, ω_lower, color=c_gravity, **line_props)
130-
ax[0].plot(ks, ω_upper, color=c_acoustic, **line_props)
132+
ax[0].plot(ks, ω_lower, color=c_gravity, label=r'$\omega_-$', **line_props)
133+
ax[0].plot(ks, ω_upper, color=c_acoustic, label=r'$\omega_+$', **line_props)
131134
#ax[0].axhline(y=1, color='black', **line_props)
132135
ax[1].plot(ks, 1/ω_lower, color=c_gravity, label=r'$\omega_-$', **line_props)
133136
#ax[1].axhline(y=1, color='black', label=r'$N$', **line_props)
@@ -150,8 +153,8 @@
150153

151154
ax_eig[0].set_ylabel(r'$\sqrt{\rho}w$')
152155
ax_eig[1].set_ylabel(r'$\sqrt{\rho}w$')
153-
ax_eig[1].text(0, 0.65, 'gravity waves\n'+r'($\omega \leq \omega_-$)', verticalalignment='center', multialignment='center', fontsize=8)
154-
ax_eig[0].text(0, 0.65, 'acoustic waves\n'+r'($\omega > \omega_+$)', verticalalignment='center', multialignment='center', fontsize=8)
156+
ax_eig[1].text(0, 0.65, 'gravity waves\n'+r'($\omega \leq \omega_-$)', verticalalignment='center', multialignment='center', fontsize=9)
157+
ax_eig[0].text(0, 0.65, 'acoustic waves\n'+r'($\omega > \omega_+$)', verticalalignment='center', multialignment='center', fontsize=9)
155158
ax_eig[1].set_xlabel(r'height $z$')
156159
ax_eig[0].set_ylim(-1.3, 1.3)
157160
ax_eig[1].set_ylim(-1.3, 1.3)
@@ -160,23 +163,23 @@
160163
ax_eig[1].yaxis.set_label_coords(-0.06, 0.5)
161164

162165
# Legends
163-
legend = ax[1].legend(ncol=2, frameon=False, fontsize=6)
166+
legend = ax[1].legend(ncol=2, loc='upper left', frameon=False, fontsize=7, handlelength=1.5)
164167
legend.get_frame().set_linewidth(0.0)
165168

166-
legend = ax_eig[1].legend(frameon=False, title=r'period $N/\omega$', loc='lower left', ncol=2, fontsize=6)
167-
plt.setp(legend.get_title(),fontsize=8)
169+
legend = ax_eig[1].legend(frameon=False, title=r'period $N/\omega$', loc='lower left', ncol=2, fontsize=7)
170+
plt.setp(legend.get_title(),fontsize=9)
168171
for line,text in zip(legend.get_lines(), legend.get_texts()):
169172
text.set_color(line.get_color())
170-
legend = ax_eig[0].legend(frameon=False, title=r'frequency $\omega/N$', loc='lower left', ncol=2, fontsize=6)
171-
plt.setp(legend.get_title(),fontsize=8)
173+
legend = ax_eig[0].legend(frameon=False, title=r'frequency $\omega/N$', loc='lower left', ncol=2, fontsize=7)
174+
plt.setp(legend.get_title(),fontsize=9)
172175
for line,text in zip(legend.get_lines(), legend.get_texts()):
173176
text.set_color(line.get_color())
174177

175178
# Save
176-
ax[0].text(-0.06, 1.0, "(a)", transform=ax[0].transAxes, fontsize=8, va='top', ha='right')
177-
ax[1].text(-0.06, 1.0, "(b)", transform=ax[1].transAxes, fontsize=8, va='top', ha='right')
178-
ax_eig[0].text(-0.06, 1.0, "(a)", transform=ax_eig[0].transAxes, fontsize=8, va='top', ha='right')
179-
ax_eig[1].text(-0.06, 1.0, "(b)", transform=ax_eig[1].transAxes, fontsize=8, va='top', ha='right')
179+
ax[0].text(-0.06, 1.0, "(a)", transform=ax[0].transAxes, fontsize=9, va='top', ha='right')
180+
ax[1].text(-0.06, 1.0, "(b)", transform=ax[1].transAxes, fontsize=9, va='top', ha='right')
181+
ax_eig[0].text(-0.06, 1.0, "(a)", transform=ax_eig[0].transAxes, fontsize=9, va='top', ha='right')
182+
ax_eig[1].text(-0.06, 1.0, "(b)", transform=ax_eig[1].transAxes, fontsize=9, va='top', ha='right')
180183

181184
fig.savefig('fig_waves_spectrum.pdf')
182185
fig_eig.savefig('fig_waves_eigenfunctions.pdf')

atmospheric_waves/solve_atmosphere.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,19 @@
209209

210210
# Plot structure
211211
fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True, figsize=(3.4, 2.8))
212-
fig.subplots_adjust(left=0.14, bottom=0.12, right=0.86, top=0.97, hspace=0.06)
212+
fig.subplots_adjust(left=0.12, bottom=0.12, right=0.86, top=0.97, hspace=0.06)
213213

214214
ax1.plot(z, ln_T['g'], label=r'$\ln \,T$', c='C0')
215215
ax1.plot(z_phot, ln_T['g'][i_tau_23], marker='.', color='black')
216216
ax1.set_ylabel(r"$\ln \,T$")
217217
axr = ax1.twinx()
218218
axr.plot(z, ln_rho['g'], label=r'$\ln\,\rho$', linestyle='dashed', c='C1')
219219
axr.plot(z, ln_rho['g']+ln_T['g'], label=r'$\ln \,P$', linestyle='dashed', c='C2')
220-
axr.set_ylabel(r"$\ln \,\rho, \ln \,P$")
220+
axr.set_ylabel(r"$\ln \,\rho, \; \ln \,P$")
221221
ax1.set_xlim([0, Lz])
222222
lines1, labels1 = ax1.get_legend_handles_labels()
223223
lines2, labels2 = axr.get_legend_handles_labels()
224-
ax1.legend(lines1+lines2, labels1+labels2, loc='lower left', frameon=False, fontsize=8, handlelength=1.8)
224+
ax1.legend(lines1+lines2, labels1+labels2, loc='lower left', frameon=False, fontsize=9, handlelength=1.8)
225225

226226
#ax.plot(z_diag, diagnostics['s_Cp']['g'], color='black', label=r'$s/c_P$')
227227
#ax.set_ylabel(r"$s/c_P$")
@@ -239,14 +239,15 @@
239239
ax2.set_ylabel(r'$\omega/N_{\mathrm{max}}$')
240240
ax2.set_xlabel(r'height $z$')
241241
lines1, labels1 = ax2.get_legend_handles_labels()
242-
legend=ax2.legend(lines1, labels1, loc='center left', frameon=False, ncol=1, fontsize=8, handlelength=1.8)
242+
legend=ax2.legend(lines1, labels1, loc='center left', frameon=False, ncol=1, fontsize=9, handlelength=1.8)
243243
legend.get_frame().set_linewidth(0.0)
244244

245245
ax2.xaxis.set_label_coords(0.5, -0.15)
246-
ax1.yaxis.set_label_coords(-0.12, 0.5)
247-
ax2.yaxis.set_label_coords(-0.12, 0.5)
248-
ax1.text(-0.12, 1.0, "(a)", transform=ax1.transAxes, fontsize=8, va='top', ha='right')
249-
ax2.text(-0.12, 1.0, "(b)", transform=ax2.transAxes, fontsize=8, va='top', ha='right')
246+
ax1.yaxis.set_label_coords(-0.08, 0.5)
247+
axr.yaxis.set_label_coords(1.1, 0.55)
248+
ax2.yaxis.set_label_coords(-0.08, 0.5)
249+
ax1.text(-0.08, 1.0, "(a)", transform=ax1.transAxes, fontsize=9, va='top', ha='right')
250+
ax2.text(-0.08, 1.0, "(b)", transform=ax2.transAxes, fontsize=9, va='top', ha='right')
250251
fig.savefig('fig_waves_atmosphere.pdf')
251252

252253
# Plot T-P

methods_paper.mplstyle

+5-5
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ font.weight : normal
126126
# settings for axes and ticks. Special text sizes can be defined
127127
# relative to font.size, using the following values: xx-small, x-small,
128128
# small, medium, large, x-large, xx-large, larger, or smaller
129-
font.size : 8
129+
font.size : 9
130130
font.serif : Times New Roman #Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
131131
#font.serif : Times New Roman
132132
#font.sans-serif : Roboto
@@ -209,9 +209,9 @@ mathtext.fontset : stix # Should be 'cm' (Computer Modern), 'stix',
209209
#axes.edgecolor : black # axes edge color
210210
axes.linewidth : 1.0 # edge linewidth
211211
#axes.grid : False # display grid or not
212-
axes.titlesize : 10 # fontsize of the axes title
212+
axes.titlesize : 9 # fontsize of the axes title
213213
axes.titleweight : normal
214-
axes.labelsize : 8 # fontsize of the x any y labels
214+
axes.labelsize : 9 # fontsize of the x any y labels
215215
axes.labelweight : normal # weight of the x and y labels
216216
#axes.labelcolor : black
217217
#axes.axisbelow : False # whether axis gridlines and ticks are below
@@ -254,7 +254,7 @@ ytick.minor.width : 1 # minor tick width in points
254254
#ytick.major.pad : 4 # distance to major tick label in points
255255
#ytick.minor.pad : 4 # distance to the minor tick label in points
256256
#ytick.color : k # color of the tick labels
257-
ytick.labelsize : 8 # fontsize of the tick labels
257+
ytick.labelsize : 9 # fontsize of the tick labels
258258
ytick.direction : in # direction: in or out
259259

260260

@@ -268,7 +268,7 @@ ytick.direction : in # direction: in or out
268268
# legend, else a rectangle
269269
#legend.isaxes : True
270270
#legend.numpoints : 2 # the number of points in the legend line
271-
legend.fontsize : 6
271+
legend.fontsize : 7
272272
#legend.pad : 0.0 # deprecated; the fractional whitespace inside the legend border
273273
#legend.borderpad : 0.5 # border whitespace in fontsize units
274274
#legend.markerscale : 1.0 # the relative size of legend markers vs. original

quasigeostrophic_flow/plot_slice.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@
5050
x = np.array(f['scales/x/4'])
5151
y = np.array(f['scales/y/4'])
5252
vort = np.array(f['tasks/vorticity-top'][0,:,:,0])
53+
b = np.array(f['tasks/buoyancy-top'][0,:,:,0])
5354
PV = np.array(f['tasks/PV-top'][0,:,:,0])
5455

5556
f.close()
5657

5758
xm, ym = plot_tools.quad_mesh(x, y)
5859

59-
data = [vort,PV]
60-
label = [r'$\omega$',r'$PV$']
60+
data = [b,PV]
61+
label = [r'$b$',r'$PV$']
6162
cmaps = ['RdBu_r','PuOr']
6263

6364
c_im = []
@@ -66,7 +67,7 @@
6667
max = 0.8*np.max(np.abs(data[i]))
6768
c_im.append(slice_axes[i].pcolormesh(xm, ym, data[i].T, vmin=-max, vmax=max, cmap=cmaps[i]))
6869

69-
slice_axes[i].axis([-40,40,-20,20])
70+
#slice_axes[i].axis([-40,40,-20,20])
7071
if i == 0:
7172
plt.setp(slice_axes[i].get_xticklabels(), visible=False)
7273
slice_axes[i].xaxis.set_major_locator(MaxNLocator(nbins=5))
@@ -75,7 +76,7 @@
7576
slice_axes[i].set_xlabel(r'$x$')
7677
slice_axes[i].xaxis.set_major_locator(MaxNLocator(nbins=5))
7778
slice_axes[i].yaxis.set_major_locator(MaxNLocator(nbins=5,prune='upper'))
78-
79+
7980
slice_axes[i].set_ylabel(r'$y$')
8081

8182
cbar.append(fig.colorbar(c_im[i], cax=cbar_axes[i], orientation='vertical', ticks=MaxNLocator(nbins=5)))

0 commit comments

Comments
 (0)