class documentation
callable instance to save and show figures from matplotlib
.
Saves figures to a folder 'figs-...' with incremental filenames allowing to conveniently view and compare these figures.
Each call of the instance saves the current matplotlib
figure and
switches the focus to the save folder by calling the open_path
method.
Example:
>> import cma, matplotlib.pyplot as plt >> show = cma.utilities.utils.ShowInline('01') # use './figs-01' folder >> >> plt.plot([1,2,3]) >> show() # save current plot with a unique name in figs-01 folder >> # and switch focus to the folder
Under macOS, open_path
invokes Finder where the figures can be
conveniently explored and compared using the space and up/down keys.
Method | __call__ |
save current figure and show folder and/or image in notebook. |
Method | __init__ |
save figures to folder 'figs-' + name. |
Method | open |
Undocumented |
Method | show |
display last saved figure in notebook (doesn't work with pdf) |
Class Variable | folder |
Undocumented |
Instance Variable | format |
filename format string |
Instance Variable | kwargs |
kwargs to plt.savefig |
Instance Variable | number |
number of saved figures or id of last saved figure |
Instance Variable | path |
output folder path |
Instance Variable | type |
Undocumented |
Instance Variable | _last |
Undocumented |
def __call__(self, keep=True, show_in_notebook=False, show_in_folder=True, save=True, width_save=None, width_show=None, name=None):
¶
save current figure and show folder and/or image in notebook.
Uses IPython.display.Image
to show the image in the notebook.