def get_plot_name(name_idx, data):
    """Returns the plot name taken from the data parameter
    Args:
        name_idx(str or list): the plot column name to look for, or an array of plot names
        data(obj): index-able object containing the values that make up the plot name
    Return:
        Returns the found plot name or None if not found
    Note:
        If the plot name consists of more than one index, the values are concatenated
        to make up the returned plot name. Indexes that are missing in the data are
        ignored. If the data doesn't contain any of the indexes, None is returned
    """
    plot_name = ""

    if isinstance(name_idx, list):
        for idx in name_idx:
            if idx in data:
                plot_name += str(data[idx]) + "_"
        plot_name = plot_name.rstrip("_")
    elif name_idx in data:
        plot_name = str(data[name_idx])

    if plot_name == "":
        plot_name = None

    return plot_name