Skip to content

Commit

Permalink
fix savefig cutting off axis
Browse files Browse the repository at this point in the history
  • Loading branch information
teopb committed Aug 4, 2023
1 parent aeffe4f commit 23b3d9f
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions MPAS_true_failure_testing/post_ect_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,11 @@ def main(argv):
print(f"EET rate: {avg_eet_fails}")

# plot perturbation outputs

# # log perturbation plot
# plt.xscale("symlog")
# plt.plot(perturbations, avg_pca_fails/PCA_dims)
# plt.xticks(perturbations)
# plt.axvline(x=0, color='r', label='axvline - full height')
# plt.title(f"MPAS UF-ECT PCA Fails vs\n {var_name} Perturbation")
# plt.ylabel("PCA Fail Percent")
# plt.xlabel("Perturbation Factor")
# plt.savefig(f"{test_output_dir}/plots/{var_name}_log_perturb_plot.png")
# plt.clf()

plot_data = (var_name, avg_pca_fails/PCA_dims, avg_eet_fails, perturbations, test_vals, default_var_value)
plot_test_results(plot_data, test_output_dir)
for pca_arg in [True, False]:
for perturb_arg in [True, False]:
for log_arg in ["log", "linear"]:
plot_test_results(plot_data, test_output_dir, plot_pca=pca_arg, plot_perturbations=perturb_arg, scale = log_arg)



Expand Down Expand Up @@ -178,7 +169,8 @@ def plot_test_results(plot_data, file_path, scale="log", plot_pca = True, plot_p
if scale == "log":
file_name = file_name + "_log"

plt.savefig(file_path + "/" + file_name)
plt.title(title)
plt.savefig(file_path + "/" + file_name, bbox_inches="tight")

plt.clf()

Expand Down

0 comments on commit 23b3d9f

Please sign in to comment.