matplotlib

matplotlib.artist.Artist.is_figure_set

Artist.is_figure_set()

Returns whether the artist is assigned to a Figure.