slmsuite.configure_plotting#
- configure_plotting(mode='show', save_dir=None, headless=False, extension='png', savefig_kwargs=None)[source]#
Configure how slmsuite plots are displayed or saved.
- Parameters:
mode (str or callable) –
One of:
"show"Pass through to
plt.show()(default)."suppress"Close all figures silently.
"save"Save figures to
save_dir(usingextensionandsavefig_kwargs), then close.- callable
Called in place of
plt.show(), though it must also acceptname=which is used to identify the plot.
save_dir (str or path-like, optional) – Output directory for
"save"mode. Created if absent. The filename stem comes from thenamepassed to_slmsuite_plt_show()(falling back to"fig").headless (bool, optional) – Switch to the
"Agg"backend and callplt.ioff(). Selecting any other matplotlib backend is left to the user (e.g. theMPLBACKENDenvironment variable or a Jupyter%matplotlibmagic).extension (str, optional) – File extension (and thus output format) for
"save"mode, e.g."png"(default),"pdf", or"svg". Ignored for other modes.savefig_kwargs (dict, optional) – Extra keyword arguments forwarded to
Figure.savefigin"save"mode, merged over the defaults{"dpi": 150, "bbox_inches": "tight"}(user keys take precedence). Ignored for other modes.