Utility Functions¶
Here are some utility functions
-
plotszoo.utils.savefig(fig, filename, create_dir_tree=True, savefig_kwargs={})¶ Save a
matplotlibfigure and creates the directory tree if it do not exists- Args:
- fig
matplotlibfigure to save- filename
The figure filename
- create_dir_tree
Create the directory tree if it does not exists (Default:
True)- savefig_kwargs
kwargs for
plt.savefig(Default:{})
- Example:
>>> plotszoo.utils.savefig("./plots/nice/first.png")
Creates the folders
./plotsand./plots/niceif they do not exists and then callsfig.savefig(filename, **savefig_kwargs)