Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Fix in case there is only one scenario to plot... #230

Merged
merged 2 commits into from
Apr 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions scripts/fast_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def generate_pdf(max_files, filename, config_file):
fig, axes = plt.subplots(len(varplot),len(all_hosp_sim), figsize =(23,20), sharex=True)
for vi, var in enumerate(varplot):
for scn, key in enumerate(list(all_hosp_sim.keys())):
ax = axes[vi][scn]
if len(all_hosp_sim) > 1:
ax = axes[vi][scn]
else:
ax = axes[vi]
ax.set_title(key)
ax.xaxis.set_major_locator(plt.MaxNLocator(12))
ax.yaxis.set_major_locator(plt.MaxNLocator(5))
Expand Down Expand Up @@ -226,10 +229,13 @@ def generate_pdf(max_files, filename, config_file):
fig, axes = plt.subplots(len(all_seir_sim_cumI),1, figsize =(15,15), sharex=True)
i=0
for key, value in all_seir_sim_cumI.items():
axes.flat[i]
if len(all_seir_sim_cumI) > 1:
ax = axes.flat[i]
else:
ax = axes
#fig, axes = plt.subplots(1,1, figsize =(10,5))
ax = value.max().hist(ax= axes.flat[i])
axes.flat[i].set_title(f"Final Size {key}")
ax = value.max().hist(ax= ax)
ax.set_title(f"Final Size {key}")
i=i+1
pdf.savefig(fig)

Expand Down