Convenience function to get the x_label of a value index
353043
def _get_x_label(self, i):
        """"""
        if not self.x_labels or not self._y_labels or len(self._y_labels) <= i:
            return
        return self._y_labels[i][0]
1172043
def yticktext(self, labels, index=1):
        
        self.layout['yaxis' + str(index)]['ticktext'] = labels
        return self
277164
def tick_label_position(self):
        
        tickLblPos = self._element.tickLblPos
        if tickLblPos is None:
            return XL_TICK_LABEL_POSITION.NEXT_TO_AXIS
        if tickLblPos.val is None:
            return XL_TICK_LABEL_POSITION.NEXT_TO_AXIS
        return tickLblPos.val
1319720
def load_label(self, idx):
        
        label_400 = scipy.io.loadmat('{}/trainval/{}.mat'.format(self.context_dir, idx))['LabelMap']
        label = np.zeros_like(label_400, dtype=np.uint8)
        for idx, l in enumerate(self.labels_59):
            idx_400 = self.labels_400.index(l) + 1
            label[label_400 == idx_400] = idx + 1
        label = label[np.newaxis, ...]
        return label
1220964
def _ixs(self, i, axis=0):
        
        label = self.index[i]
        if isinstance(label, Index):
            return self.take(i, axis=axis)
        else:
            return self._get_val_at(i)
1241640
def _x_axis(self):
        """"""
        if not self._x_labels or not self.show_x_labels:
            return
        axis = self.svg.node(
            self.nodes['plot'],
            class_="axis x%s" % (' always_show' if self.show_x_guides else '')
        )
        truncation = self.truncate_label
        if not truncation:
            if self.x_label_rotation or len(self._x_labels) <= 1:
                truncation = 25
            else:
                first_label_position = self.view.x(self._x_labels[0][1]) or 0
                last_label_position = self.view.x(self._x_labels[-1][1]) or 0
                available_space = (last_label_position - first_label_position
                                   ) / len(self._x_labels) - 1

                truncation = reverse_text_len(
                    available_space, self.style.label_font_size
                )
                truncation = max(truncation, 1)

        lastlabel = self._x_labels[-1][0]
        if 0 not in [label[1] for label in self._x_labels]:
            self.svg.node(
                axis,
                'path',
                d='M%f %f v%f' % (0, 0, self.view.height),
                class_='line'
            )
            lastlabel = None

        for label, position in self._x_labels:
            if self.horizontal:
                major = position in self._x_labels_major
            else:
                major = label in self._x_labels_major
            if not (self.show_minor_x_labels or major):
                continue
            guides = self.svg.node(axis, class_='guides')
            x = self.view.x(position)
            if x is None:
                continue
            y = self.view.height + 5
            last_guide = (self._y_2nd_labels and label == lastlabel)
            self.svg.node(
                guides,
                'path',
                d='M%f %f v%f' % (x or 0, 0, self.view.height),
                class_='%s%s%sline' % (
                    'axis ' if label == "0" else '', 'major '
                    if major else '', 'guide '
                    if position != 0 and not last_guide else ''
                )
            )
            y += .5 * self.style.label_font_size + 5
            text = self.svg.node(
                guides, 'text', x=x, y=y, class_='major' if major else ''
            )

            text.text = truncate(label, truncation)
            if text.text != label:
                self.svg.node(guides, 'title').text = label
            elif self._dual:
                self.svg.node(
                    guides,
                    'title',
                ).text = self._x_format(position)

            if self.x_label_rotation:
                text.attrib['transform'] = "rotate(%d %f %f)" % (
                    self.x_label_rotation, x, y
                )
                if self.x_label_rotation >= 180:
                    text.attrib['class'] = ' '.join((
                        text.attrib['class']
                        and text.attrib['class'].split(' ') or []
                    ) + ['backwards'])

        if self._y_2nd_labels and 0 not in [label[1]
                                            for label in self._x_labels]:
            self.svg.node(
                axis,
                'path',
                d='M%f %f v%f' % (self.view.width, 0, self.view.height),
                class_='line'
            )

        if self._x_2nd_labels:
            secondary_ax = self.svg.node(
                self.nodes['plot'],
                class_="axis x x2%s" %
                (' always_show' if self.show_x_guides else '')
            )
            for label, position in self._x_2nd_labels:
                major = label in self._x_labels_major
                if not (self.show_minor_x_labels or major):
                    continue
                # it is needed, to have the same structure as primary axis
                guides = self.svg.node(secondary_ax, class_='guides')
                x = self.view.x(position)
                y = -5
                text = self.svg.node(
                    guides, 'text', x=x, y=y, class_='major' if major else ''
                )
                text.text = label
                if self.x_label_rotation:
                    text.attrib['transform'] = "rotate(%d %f %f)" % (
                        -self.x_label_rotation, x, y
                    )
                    if self.x_label_rotation >= 180:
                        text.attrib['class'] = ' '.join((
                            text.attrib['class']
                            and text.attrib['class'].split(' ') or []
                        ) + ['backwards'])
454958
function (index, datasetIndex) {
      var me = this;
      var label = me.chart.data.labels && index < me.chart.data.labels.length ? me.chart.data.labels[index] : '';

      if (typeof me.chart.data.datasets[datasetIndex].data[0] === 'object') {
        if (me.isHorizontal()) {
          label = me.chart.data.datasets[datasetIndex].data[index].x;
        } else {
          label = me.chart.data.datasets[datasetIndex].data[index].y;
        }
      }

      return prettyPrintDuration(me.parseDuration(label));
    }
1182028
def _get_x(self, kwargs):
        '''
        
        '''
        if 'x' in kwargs:
            return round(float(kwargs['x']), 6)
        elif self._element_x in kwargs:
            return round(float(kwargs[self._element_x]), 6)
        elif self._type == 3 and self._element_1mx in kwargs:
            return round(1. - float(kwargs[self._element_1mx]), 6)
        else:
            raise TypeError()
32947
def get_index_text(self, prefix, name_obj):
        """"""
        (name, _) = name_obj
        msg = '{name} ({obj_type})'
        parts = {
            'name': name,
            'prefix': prefix,
            'obj_type': self.long_name,
        }
        try:
            (obj_ns, obj_name) = name.rsplit('.', 1)
            parts['name'] = obj_name
            parts['namespace'] = obj_ns
            msg = '{name} ({namespace} {obj_type})'
        except ValueError:
            pass

        return msg.format(**parts)
1030201
def getvalue(x):
    """"""
    if isrepeating(x):
        raise TypeError(
            "Ambiguous call to getvalue for %r which has more than one value."
            % x)

    for value in getvalues(x):
        return value
498489
def label(self,x,y,label,offset=[0,0]):
        """"""
        (xc,yc)=self.p2c([x,y])
        return self.create_text(xc-offset[0],yc-offset[1],text=label)
33320
def _pprint(self, element, dim_label, vals):
        

        if vals.dtype.kind not in 'SU':
            dim = element.gridded.get_dimension(dim_label)
            return [dim.pprint_value(v) for v in vals]

        return vals
629414
def data_in_label(intvl_in, dtype_in_time, dtype_in_vert=False):
    """"""
    intvl_lbl = intvl_in
    time_lbl = dtype_in_time
    lbl = '_'.join(['from', intvl_lbl, time_lbl]).replace('__', '_')
    vert_lbl = dtype_in_vert if dtype_in_vert else False
    if vert_lbl:
        lbl = '_'.join([lbl, vert_lbl]).replace('__', '_')
    return lbl
1205203
def match_axis_label_suffix(str)
      best = [nil, nil]
      Unit.each do |unit|
        label_s = unit.label.to_s
        best = [label_s, unit] if suffix?(label_s, str) and (best.first.nil? or label_s.length > best.first.length)
      end
      best
    end
567044
def xlabel(self, labels):
        
        if self.panel_scales_x[0].name is not None:
            return self.panel_scales_x[0].name
        else:
            return labels.get('x', '')
973002
def get_axis_properties(axis):
    """"""
    props = {}
    label1On = axis._major_tick_kw.get('label1On', True)

    if isinstance(axis, matplotlib.axis.XAxis):
        if label1On:
            props['position'] = "bottom"
        else:
            props['position'] = "top"
    elif isinstance(axis, matplotlib.axis.YAxis):
        if label1On:
            props['position'] = "left"
        else:
            props['position'] = "right"
    else:
        raise ValueError("{0} should be an Axis instance".format(axis))

    # Use tick values if appropriate
    locator = axis.get_major_locator()
    props['nticks'] = len(locator())
    if isinstance(locator, ticker.FixedLocator):
        props['tickvalues'] = list(locator())
    else:
        props['tickvalues'] = None

    # Find tick formats
    formatter = axis.get_major_formatter()
    if isinstance(formatter, ticker.NullFormatter):
        props['tickformat'] = ""
    elif isinstance(formatter, ticker.FixedFormatter):
        props['tickformat'] = list(formatter.seq)
    elif not any(label.get_visible() for label in axis.get_ticklabels()):
        props['tickformat'] = ""
    else:
        props['tickformat'] = None

    # Get axis scale
    props['scale'] = axis.get_scale()

    # Get major tick label size (assumes that's all we really care about!)
    labels = axis.get_ticklabels()
    if labels:
        props['fontsize'] = labels[0].get_fontsize()
    else:
        props['fontsize'] = None

    # Get associated grid
    props['grid'] = get_grid_style(axis)

    return props
88441
def labels(indices, node_labels=None):
    """"""
    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)