Skip to content

Commit

Permalink
small plotting update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Reep authored and Jeffrey Reep committed Jul 9, 2024
1 parent 5f92b7e commit 5e83164
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/scripts/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from matplotlib import pyplot as plt

def plot_figures(time, temperature, density, L, H, t, filename=None, xlim=None):
def plot_figures(time, temperature, density, L, H, t, filename=None, xlim=None, show_legend=False):
"""
Plot the temperature, density, and abundance factor as a function of time for
a given set of simulations
Expand Down Expand Up @@ -48,7 +48,7 @@ def plot_figures(time, temperature, density, L, H, t, filename=None, xlim=None):
plt.grid('-')
if xlim is not None:
plt.xlim(xlim)
if H == '0.01' and L == '40':
if show_legend':
plt.legend(fontsize=18)
plt.savefig(paths.figures / ('temperature_' + filename), dpi=300)
plt.close()
Expand Down
7 changes: 6 additions & 1 deletion src/scripts/render_figure1.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

plot_figures(time, temperature, density, L, H, t)
if H == '0.01':
show_legend = True
else:
show_legend = False

plot_figures(time, temperature, density, L, H, t, show_legend=show_legend)
7 changes: 6 additions & 1 deletion src/scripts/render_figure2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

plot_figures(time, temperature, density, L, H, t)
if H == '0.01':
show_legend = True
else:
show_legend = False

plot_figures(time, temperature, density, L, H, t, show_legend=show_legend)
8 changes: 7 additions & 1 deletion src/scripts/render_figure3.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
temperature = [T_e_v, T_e_p, T_e_c]
density = [n_v, n_p, n_c]

if L == '40':
show_legend = True
else:
show_legend = False


plot_figures(time, temperature, density, L, H, t,
filename = 'train_L'+L+'_H'+H+'_t'+t+'.png',
xlim = [0, 40])
xlim = [0, 40], show_legend=show_legend)

0 comments on commit 5e83164

Please sign in to comment.