def all_artists(fig):
    """
    Build a set of all Matplotlib artists in a Figure

    Parameters
    ----------
    fig : :func:`matplotlib.pyplot.figure`
        Matplotlib figure.
    """
    return set(item
               for axes in fig.axes
               for container in [axes.collections, axes.patches, axes.lines,
                                 axes.texts, axes.artists, axes.images]
               for item in container)