Skip to content

Commit d167700

Browse files
committed
Python: add usetex for compression_wave.py
1 parent bd74cd8 commit d167700

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Utilities/Python/scripts/compression_wave.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,13 @@ def clog(real_expr):
123123
x_min=0, x_max=12.5, y_min=0, y_max=8,
124124
revision_label=version_string,
125125
x_label='Time (s)',
126-
y_label='Density (kg/m$^3$)')
126+
y_label=r'Density (kg/m$^3$)',
127+
usetex=True)
127128

128-
fdsplotlib.plot_to_fig(x_data=t_FL4_16, y_data=rho_fds_FL4_16, marker_style='c--', data_label='FDS $N=16$', figure_handle=fig)
129-
fdsplotlib.plot_to_fig(x_data=t_FL4_32, y_data=rho_fds_FL4_32, marker_style='g--', data_label='FDS $N=32$', figure_handle=fig)
130-
fdsplotlib.plot_to_fig(x_data=t_FL4_64, y_data=rho_fds_FL4_64, marker_style='b--', data_label='FDS $N=64$', figure_handle=fig)
131-
fdsplotlib.plot_to_fig(x_data=t_FL4_128,y_data=rho_fds_FL4_128,marker_style='r--', data_label='FDS $N=128$',figure_handle=fig)
129+
fdsplotlib.plot_to_fig(x_data=t_FL4_16, y_data=rho_fds_FL4_16, marker_style='c--', data_label=r'FDS $N=16$', figure_handle=fig)
130+
fdsplotlib.plot_to_fig(x_data=t_FL4_32, y_data=rho_fds_FL4_32, marker_style='g--', data_label=r'FDS $N=32$', figure_handle=fig)
131+
fdsplotlib.plot_to_fig(x_data=t_FL4_64, y_data=rho_fds_FL4_64, marker_style='b--', data_label=r'FDS $N=64$', figure_handle=fig)
132+
fdsplotlib.plot_to_fig(x_data=t_FL4_128,y_data=rho_fds_FL4_128,marker_style='r--', data_label=r'FDS $N=128$',figure_handle=fig)
132133

133134
plt.savefig(os.path.join(pltdir, 'compression_wave_time_series.pdf'), format='pdf')
134135
plt.close()
@@ -140,14 +141,15 @@ def clog(real_expr):
140141
e_FL2 = np.array([error_FL2_16, error_FL2_32, error_FL2_64, error_FL2_128])
141142
e_FL4 = np.array([error_FL4_16, error_FL4_32, error_FL4_64, error_FL4_128])
142143

143-
fig = fdsplotlib.plot_to_fig(x_data=h, y_data=0.1*h, marker_style='k--', data_label=r'$O(\delta x)$',
144+
fig = fdsplotlib.plot_to_fig(x_data=h, y_data=0.1*h, marker_style='k--', data_label=r'${\cal O}(\delta x)$',
144145
x_min=1e-2, x_max=1, y_min=1e-4, y_max=1e-1,
145146
plot_type='loglog',
146147
revision_label=version_string,
147148
x_label='Grid Spacing (m)',
148-
y_label='L$_2$ Error (kg/m$^3$)')
149+
y_label=r'L2 Error (kg/m$^3$)',
150+
usetex=True)
149151

150-
fdsplotlib.plot_to_fig(x_data=h, y_data=0.1*h**2, marker_style='k-', data_label=r'$O(\delta x^2)$', figure_handle=fig)
152+
fdsplotlib.plot_to_fig(x_data=h, y_data=0.1*h**2, marker_style='k-', data_label=r'${\cal O}(\delta x^2)$', figure_handle=fig)
151153
fdsplotlib.plot_to_fig(x_data=h, y_data=e_FL0, marker_style='b*-', data_label='Central', figure_handle=fig)
152154
fdsplotlib.plot_to_fig(x_data=h, y_data=e_FL2, marker_style='ro-', data_label='Superbee', figure_handle=fig)
153155
fdsplotlib.plot_to_fig(x_data=h, y_data=e_FL4, marker_style='g^-', data_label='CHARM', figure_handle=fig)

0 commit comments

Comments
 (0)