uaf-arctic-eco-modeling / dvm-dos-tem

A process based Dynamic Vegetation, Dynamic Organic Soil, Terrestrial Ecosystem Model.
MIT License
22 stars 24 forks source link

SA_post_hoc_analysis, plotting save paths/locations. #653

Closed tobeycarman closed 8 months ago

tobeycarman commented 9 months ago

SA_post_hoc_analysis.plot_boxplots and SA_post_hoc_analysis.plot_relationships function both need plots/ directory to exist prior to running.... OR need to change default save location so that it does not include a directory path that may or may not exist.

One idea is that all plot functions be standardized with a saveprefix=''. If nothing is provided for saveprefix, the plot will save in the current working directory with a name that directly reflects the function name (i.e. plot_relationships(...) results in a file like plot_relationships.png. If saveprefix is specified, that the value is prepended to the default filename.

tobeycarman commented 9 months ago

This problem exists in SA_post_hoc_analysis.plot_output_scatter(...) function as well...

Benjamin-Maglio commented 8 months ago

Fixed by commit 2d35b05fde466c4993263746bc302e06a9b7374f

Added save=False, saveprefix='' to all plotting functions. With:

if save:
    plt.savefig(saveprefix+'plot_name.png', bbox_inches='tight')