當前位置: 首頁>>代碼示例>>Python>>正文


Python artist.setp方法代碼示例

本文整理匯總了Python中matplotlib.artist.setp方法的典型用法代碼示例。如果您正苦於以下問題:Python artist.setp方法的具體用法?Python artist.setp怎麽用?Python artist.setp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在matplotlib.artist的用法示例。


在下文中一共展示了artist.setp方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_setp

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def test_setp():
    # Check empty list
    plt.setp([])
    plt.setp([[]])

    # Check arbitrary iterables
    fig, axes = plt.subplots()
    lines1 = axes.plot(range(3))
    lines2 = axes.plot(range(3))
    martist.setp(chain(lines1, lines2), 'lw', 5)
    plt.setp(axes.spines.values(), color='green')

    # Check `file` argument
    sio = io.StringIO()
    plt.setp(lines1, 'zorder', file=sio)
    assert sio.getvalue() == '  zorder: float\n' 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:18,代碼來源:test_artist.py

示例2: grid

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def grid(self, b=None, which='major', axis="both", **kwargs):
        """
        Toggle the gridlines, and optionally set the properties of the lines.
        """
        # their are some discrepancy between the behavior of grid in
        # axes_grid and the original mpl's grid, because axes_grid
        # explicitly set the visibility of the gridlines.

        super().grid(b, which=which, axis=axis, **kwargs)
        if not self._axisline_on:
            return

        if b is None:
            b = (self.axes.xaxis._gridOnMinor
                    or self.axes.xaxis._gridOnMajor
                    or self.axes.yaxis._gridOnMinor
                    or self.axes.yaxis._gridOnMajor)

        self.gridlines.set_which(which)
        self.gridlines.set_axis(axis)
        self.gridlines.set_visible(b)

        if len(kwargs):
            martist.setp(self.gridlines, **kwargs) 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:26,代碼來源:axislines.py

示例3: test_setp

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def test_setp():
    # Check empty list
    plt.setp([])
    plt.setp([[]])

    # Check arbitrary iterables
    fig, axes = plt.subplots()
    lines1 = axes.plot(range(3))
    lines2 = axes.plot(range(3))
    martist.setp(chain(lines1, lines2), 'lw', 5)
    plt.setp(axes.spines.values(), color='green')

    # Check `file` argument
    sio = io.StringIO()
    plt.setp(lines1, 'zorder', file=sio)
    assert sio.getvalue() == '  zorder: float \n' 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:18,代碼來源:test_artist.py

示例4: grid

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def grid(self, b=None, which='major', **kwargs):
        """
        Set the axis grid on or off; b is a boolean. Use *which* =
        'major' | 'minor' | 'both' to set the grid for major or minor ticks.

        If *b* is *None* and len(kwargs)==0, toggle the grid state.  If
        *kwargs* are supplied, it is assumed you want the grid on and *b*
        will be set to True.

        *kwargs* are used to set the line properties of the grids, eg,

          xax.grid(color='r', linestyle='-', linewidth=2)
        """
        if len(kwargs):
            b = True
        which = which.lower()
        if which in ['minor', 'both']:
            if b is None:
                self._gridOnMinor = not self._gridOnMinor
            else:
                self._gridOnMinor = b
            for tick in self.minorTicks:  # don't use get_ticks here!
                if tick is None:
                    continue
                tick.gridOn = self._gridOnMinor
                if len(kwargs):
                    artist.setp(tick.gridline, **kwargs)
            self._minor_tick_kw['gridOn'] = self._gridOnMinor
        if which in ['major', 'both']:
            if b is None:
                self._gridOnMajor = not self._gridOnMajor
            else:
                self._gridOnMajor = b
            for tick in self.majorTicks:  # don't use get_ticks here!
                if tick is None:
                    continue
                tick.gridOn = self._gridOnMajor
                if len(kwargs):
                    artist.setp(tick.gridline, **kwargs)
            self._major_tick_kw['gridOn'] = self._gridOnMajor 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:42,代碼來源:axis.py

示例5: setp

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def setp(*args, **kwargs):
    ret = _setp(*args, **kwargs)
    draw_if_interactive()
    return ret 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:6,代碼來源:pyplot.py

示例6: grid

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def grid(self, b=None, which='major', axis="both", **kwargs):
        """
        Toggle the gridlines, and optionally set the properties of the lines.
        """
        # their are some discrepancy between the behavior of grid in
        # axes_grid and the original mpl's grid, because axes_grid
        # explicitly set the visibility of the gridlines.

        super(Axes, self).grid(b, which=which, axis=axis, **kwargs)
        if not self._axisline_on:
            return

        if b is None:

            if self.axes.xaxis._gridOnMinor or self.axes.xaxis._gridOnMajor or \
                   self.axes.yaxis._gridOnMinor or self.axes.yaxis._gridOnMajor:
                b=True
            else:
                b=False

        self.gridlines.set_which(which)
        self.gridlines.set_axis(axis)
        self.gridlines.set_visible(b)

        if len(kwargs):
            martist.setp(self.gridlines, **kwargs) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:28,代碼來源:axislines.py

示例7: cla

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def cla(self):
        self._get_base_axes_attr("cla")(self)

        martist.setp(self.get_children(), visible=False)
        self._get_lines = self._parent_axes._get_lines

        # In mpl's Axes, zorders of x- and y-axis are originally set
        # within Axes.draw().
        if self._axisbelow:
            self.xaxis.set_zorder(0.5)
            self.yaxis.set_zorder(0.5)
        else:
            self.xaxis.set_zorder(2.5)
            self.yaxis.set_zorder(2.5) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:16,代碼來源:parasite_axes.py

示例8: setp

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def setp(obj, *args, **kwargs):
    return _setp(obj, *args, **kwargs) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:4,代碼來源:pyplot.py

示例9: grid

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def grid(self, b=None, which='major', axis="both", **kwargs):
        """
        Toggle the gridlines, and optionally set the properties of the lines.
        """
        # their are some discrepancy between the behavior of grid in
        # axes_grid and the original mpl's grid, because axes_grid
        # explicitly set the visibility of the gridlines.

        super().grid(b, which=which, axis=axis, **kwargs)
        if not self._axisline_on:
            return

        if b is None:

            if self.axes.xaxis._gridOnMinor or self.axes.xaxis._gridOnMajor or \
                   self.axes.yaxis._gridOnMinor or self.axes.yaxis._gridOnMajor:
                b=True
            else:
                b=False

        self.gridlines.set_which(which)
        self.gridlines.set_axis(axis)
        self.gridlines.set_visible(b)

        if len(kwargs):
            martist.setp(self.gridlines, **kwargs) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:28,代碼來源:axislines.py

示例10: cla

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def cla(self):
        super().cla()

        martist.setp(self.get_children(), visible=False)
        self._get_lines = self._parent_axes._get_lines

        # In mpl's Axes, zorders of x- and y-axis are originally set
        # within Axes.draw().
        if self._axisbelow:
            self.xaxis.set_zorder(0.5)
            self.yaxis.set_zorder(0.5)
        else:
            self.xaxis.set_zorder(2.5)
            self.yaxis.set_zorder(2.5) 
開發者ID:boris-kz,項目名稱:CogAlg,代碼行數:16,代碼來源:parasite_axes.py

示例11: setp

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def setp(*args, **kwargs):
    return _setp(*args, **kwargs) 
開發者ID:alvarobartt,項目名稱:twitter-stock-recommendation,代碼行數:4,代碼來源:pyplot.py

示例12: __init__

# 需要導入模塊: from matplotlib import artist [as 別名]
# 或者: from matplotlib.artist import setp [as 別名]
def __init__(self,
                 edgecolor=None,
                 facecolor=None,
                 color=None,
                 linewidth=None,
                 linestyle=None,
                 antialiased=None,
                 hatch=None,
                 fill=True,
                 **kwargs):
        """
        The following kwarg properties are supported

        %(Patch)s
        """
        artist.Artist.__init__(self)

        if linewidth is None:
            linewidth = mpl.rcParams['patch.linewidth']
        if linestyle is None:
            linestyle = "solid"
        if antialiased is None:
            antialiased = mpl.rcParams['patch.antialiased']

        self._fill = True  # needed for set_facecolor call
        if color is not None:
            if (edgecolor is not None or
                facecolor is not None):
                import warnings
                warnings.warn("Setting the 'color' property will override"
                              "the edgecolor or facecolor properties. ")
            self.set_color(color)
        else:
            self.set_edgecolor(edgecolor)
            self.set_facecolor(facecolor)
        self.set_linewidth(linewidth)
        self.set_linestyle(linestyle)
        self.set_antialiased(antialiased)
        self.set_hatch(hatch)
        self.set_fill(fill)
        self._combined_transform = transforms.IdentityTransform()

        if len(kwargs):
            artist.setp(self, **kwargs) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:46,代碼來源:patches.py


注:本文中的matplotlib.artist.setp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。