def _get_colorbar_axes(axes):
    """
    Helper function which returns all axes of colorbars linked to artists.

    Parameters
    ----------
    axes : list
        A list of matplotlib Axes.

    Returns
    -------
    cb_axes : set
    """
    cb_axes = []
    for ax in axes:
        for artist_type in ['images', 'collections']:
            for artist in getattr(ax, artist_type):
                if artist.colorbar is not None:
                    cb_axes.append(artist.colorbar.ax)
    return cb_axes
