matplotlib

matplotlib.axis.Axis.is_figure_set

Axis.is_figure_set()

Returns whether the artist is assigned to a Figure.