コード例 #1
0
    def text(self, x, y, s, *args, **kwargs):
        """
        Call signature::

          figtext(x, y, s, fontdict=None, **kwargs)

        Add text to figure at location *x*, *y* (relative 0-1
        coords). See :func:`~matplotlib.pyplot.text` for the meaning
        of the other arguments.

        kwargs control the :class:`~matplotlib.text.Text` properties:

        %(Text)s
        """

        override = _process_text_args({}, *args, **kwargs)
        t = Text(
            x=x,
            y=y,
            text=s,
        )

        t.update(override)
        self._set_artist_props(t)
        self.texts.append(t)
        return t
コード例 #2
0
ファイル: figure.py プロジェクト: KennethNielsen/matplotlib
    def text(self, x, y, s, *args, **kwargs):
        """
        Add text to figure.

        Call signature::

          text(x, y, s, fontdict=None, **kwargs)

        Add text to figure at location *x*, *y* (relative 0-1
        coords). See :func:`~matplotlib.pyplot.text` for the meaning
        of the other arguments.

        kwargs control the :class:`~matplotlib.text.Text` properties:

        %(Text)s
        """

        override = _process_text_args({}, *args, **kwargs)
        t = Text(
            x=x, y=y, text=s,
            )

        t.update(override)
        self._set_artist_props(t)
        self.texts.append(t)
        return t
コード例 #3
0
    def text(self, x, y, s, *args, **kwargs):
        """
        Add text to figure at location x,y (relative 0-1 coords) See
        the help for Axis text for the meaning of the other arguments
        """

        override = _process_text_args({}, *args, **kwargs)
        t = Text(x=x, y=y, text=s)

        t.update(override)
        self._set_artist_props(t)
        self.texts.append(t)
        return t
コード例 #4
0
ファイル: figure.py プロジェクト: jtomase/matplotlib
    def text(self, x, y, s, *args, **kwargs):
        """
        Add text to figure at location x,y (relative 0-1 coords) See
        the help for Axis text for the meaning of the other arguments
        """

        override = _process_text_args({}, *args, **kwargs)
        t = Text(
            x=x, y=y, text=s,
            )

        t.update(override)
        self._set_artist_props(t)
        self.texts.append(t)
        return t
コード例 #5
0
    def set_ticklabels(self, ticklabels, *args, **kwargs):
        """
        Set the text values of the tick labels.  ticklabels is a
        sequence of strings.  Return a list of Text instances
        """
        ticklabels = [str(l) for l in ticklabels]

        self.set_major_formatter(FixedFormatter(ticklabels))

        override = {}
        override = _process_text_args(override, *args, **kwargs)

        ret = []
        for i, tick in enumerate(self.get_major_ticks()):
            if i < len(ticklabels): ret.append(tick.label1)
            tick.label1.update(override)
        return ret
コード例 #6
0
    def set_ticklabels(self, ticklabels, *args, **kwargs):
        """
        Set the text values of the tick labels.  ticklabels is a
        sequence of strings.  Return a list of Text instances
        """
        ticklabels = [str(l) for l in ticklabels]

        self.set_major_formatter( FixedFormatter(ticklabels) )

    
        override = {}
        override = _process_text_args(override, *args, **kwargs)

        ret = []
        for i, tick in enumerate(self.get_major_ticks()):
            if i<len(ticklabels): ret.append(tick.label1)
            tick.label1.update(override)
        return ret