def METHOD_NAME(self, name, new_data, generate_name=False):
    """Sets the specified array as the value for either the specified
    name or a generated name.
    If the instance's `writable` attribute is True, then this method sets
    the data associated with the given name to the new value, otherwise it
    does nothing.
    Parameters
    ----------
    name : string
        The name of the array whose value is to be set.
    new_data : array
        The array to set as the value of *name*.
    generate_name : Boolean
        If True, a unique name of the form 'seriesN' is created for the
        array, and is used in place of *name*. The 'N' in 'seriesN' is
        one greater the largest N already used.
    Returns
    -------
    The name under which the array was set.
    See Also
    --------
    update_data: Use if needing to set multiple ArrayPlotData entries at
        once, for example because new arrays' dimensions change and
        updating one at a time would break an existing Plot.
    """
    if not self.writable:
        return None
    if generate_name:
        names = self._generate_names(1)
        name = names[0]
    self.update_data({name: new_data})
    return name