Set the legend labels.

            Args:
                values (list): list of labels.

            Raises:
                ValueError: legend must be a list of labels.
186695
def legend(self, values):
        
        if not isinstance(values, list):
            raise TypeError("legend must be a list of labels")

        self.options["legend"] = values
930918
def legend_scaler(legend_values, max_labels=10.0):
    
    if len(legend_values) < max_labels:
        legend_ticks = legend_values
    else:
        spacer = int(math.ceil(len(legend_values)/max_labels))
        legend_ticks = []
        for i in legend_values[::spacer]:
            legend_ticks += [i]
            legend_ticks += ['']*(spacer-1)
    return legend_ticks
333875
def plot(self, label=None, colour='g', style='-'): # pragma: no cover
        ''''''
        pylab = LazyImport.pylab()
        pylab.plot(self.dates, self.values, '%s%s' % (colour, style), label=label)
        if label is not None:
            pylab.legend()
        pylab.show()
1011447
def set(self, name, value):
        
        flag = self.flags[name]
        self._value = (self.value | flag) if value else (self.value & ~flag)
7711
def setValue( self, value ):
        
        scene = self.scene()
        point = scene.mapFromChart(value, None)
        
        self.setPos(point.x(), self.pos().y())
        self.rebuild(scene.gridRect())
1142826
def add(self, labels, value):
        

        try:
            current = self.get_value(labels)
        except KeyError:
            current = 0

        self.set_value(labels, current + value)
740266
def labels(self, value):
        
        if value is not None:
            assert type(value) is tuple, "'{0}' attribute: '{1}' type is not 'tuple'!".format("labels", value)
            assert len(value) == 2, "'{0}' attribute: '{1}' length should be '2'!".format("labels", value)
            for index in range(len(value)):
                assert type(value[index]) is unicode, \
                    "'{0}' attribute element '{1}': '{2}' type is not 'unicode'!".format("labels", index, value)
        self.__labels = value
629260
def set(self, locs, values):
        
        values = conversion.ensure_datetime64ns(values, copy=False)

        self.values[locs] = values
430491
def legends(value):
        
        for i, entry in enumerate(value):
            _assert_is_type('legends[{0}]'.format(i), entry, Legend)
647335
private void setValue(Collection<R> values) {
        Collection<R> oldValues = this.values;
        this.values = values;
        maybeNotifyListeners(oldValues, values);
    }
745216
def setValue(self, value):
        
        self.__value = projex.text.decoded(value) if isinstance(value, (str, unicode)) else value
670504
def AddLabels(self, labels):
    
    for label in labels:
      if not self._VALID_LABEL_REGEX.match(label):
        raise ValueError((
            'Unsupported label: "{0:s}". A label must only consist of '
            'alphanumeric characters or underscores.').format(label))

    for label in labels:
      if label not in self.labels:
        self.labels.append(label)
1228941
def show_confidence_band(self, value):
        
        if not isinstance(values, list):
            raise TypeError("show_confidence_band must be a list of strings")

        self.options["show_confidence_band"] = values
240073
def SetValue(self, identifier, value):
    
    if not isinstance(identifier, py2to3.STRING_TYPES):
      raise TypeError('Identifier not a string type.')

    identifier = identifier.lower()
    self._values[identifier] = value
931783
def set_free_parameters(self, values):
        

        assert len(values) == len(self.free_parameters)

        for parameter, this_value in zip(self.free_parameters.values(), values):

            parameter.value = this_value
919370
def node_labels(node_labels, node_indices):
    """"""
    if len(node_labels) != len(node_indices):
        raise ValueError("Labels {0} must label every node {1}.".format(
            node_labels, node_indices))

    if len(node_labels) != len(set(node_labels)):
        raise ValueError("Labels {0} must be unique.".format(node_labels))
1055228
def setValues(self, values):
        
        ncols = self.getNumCols()
        nindices = self.getNumIndices()
        for key, value in values.items():
            key = Utils.convToList(key)
            assert len(key) == nindices
            value = Utils.convToList(value)
            assert len(value) == ncols-nindices
            self.addRow(key + value)