tabensemb.trainer.Trainer._plot_action_after_plot#

method

Trainer._plot_action_after_plot(fig_name, disable: bool, ax_or_fig=None, xlabel: str | None = None, ylabel: str | None = None, save_show_close: bool = True, tight_layout=False, savefig_kwargs: Dict | None = None) Axes | Figure | Any[source]#

Set the labels of x/y-axis, set the layout, save the current figure, show the figure if in a notebook, and close the figure.

Parameters:
fig_name

The path to save the figure. Can be updated by savefig_kwargs using the key fname

ax_or_fig

matplotlib.axes.Axes or matplotlib.figure.Figure. If is a matplotlib.axes.Axes, x/y-axis labels will be set using xlabel and ylabel.

disable

True to disable the action. ax_or_fig is still returned.

xlabel

The label of the x-axis. Will be set only when ax_or_fig is a matplotlib.axes.Axes.

ylabel

The label of the y-axis. Will be set only when ax_or_fig is a matplotlib.axes.Axes.

save_show_close

Whether to save, show (in the notebook), and close the figure if ax is not given.

tight_layout

If True, plt.tight_layout is called.

savefig_kwargs

Arguments for plt.savefig.

Returns:
matplotlib.axes.Axes or matplotlib.figure.Figure

Just the input ax_or_fig