def _autoname_plots(plotlist, sequential=False):
    """
    Automatically name any plots that were not given a name by the user.
    """
    namelist = []

    count = 0
    for plot in plotlist:
        if plot.get('type') == 'figure':
            continue
        name = plot.get('axes')
        if name is None:
            if sequential:
                num = count
            else:
                num = 0
            name = '_autoname_{:02d}'.format(num)
            count += 1
        plot['axes'] = name
        namelist.append(name)

    # Extract the unique names in order.
    namelist = list(dict.fromkeys(namelist))
    return namelist