Utility Functions

Here are some utility functions

plotszoo.utils.savefig(fig, filename, create_dir_tree=True, savefig_kwargs={})

Save a matplotlib figure and creates the directory tree if it do not exists

Args:
fig

matplotlib figure 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 ./plots and ./plots/nice if they do not exists and then calls fig.savefig(filename, **savefig_kwargs)