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_kwargsusing the keyfname- ax_or_fig
matplotlib.axes.Axesormatplotlib.figure.Figure. If is amatplotlib.axes.Axes, x/y-axis labels will be set usingxlabelandylabel.- disable
True to disable the action.
ax_or_figis still returned.- xlabel
The label of the x-axis. Will be set only when
ax_or_figis amatplotlib.axes.Axes.- ylabel
The label of the y-axis. Will be set only when
ax_or_figis amatplotlib.axes.Axes.- save_show_close
Whether to save, show (in the notebook), and close the figure if
axis not given.- tight_layout
If True,
plt.tight_layoutis called.- savefig_kwargs
Arguments for
plt.savefig.
- Returns:
- matplotlib.axes.Axes or matplotlib.figure.Figure
Just the input
ax_or_fig