当前位置: 首页>>代码示例>>Python>>正文


Python Patch.__init__方法代码示例

本文整理汇总了Python中matplotlib.patches.Patch.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Patch.__init__方法的具体用法?Python Patch.__init__怎么用?Python Patch.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.patches.Patch的用法示例。


在下文中一共展示了Patch.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
    def __init__(self, bbox, **kwargs):
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
开发者ID:7924102,项目名称:matplotlib,代码行数:9,代码来源:inset_locator.py

示例2: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
    def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
        """
        Connect two bboxes with a straight line.

        Parameters
        ----------
        bbox1, bbox2 : `matplotlib.transforms.Bbox`
            Bounding boxes to connect.

        loc1 : {1, 2, 3, 4}
            Corner of *bbox1* to draw the line. Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        loc2 : {1, 2, 3, 4}, optional
            Corner of *bbox2* to draw the line. If None, defaults to *loc1*.
            Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        **kwargs
            Patch properties for the line drawn. Valid arguments include:

            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        if 'fill' in kwargs:
            Patch.__init__(self, **kwargs)
        else:
            fill = bool({'fc', 'facecolor', 'color'}.intersection(kwargs))
            Patch.__init__(self, fill=fill, **kwargs)
        self.bbox1 = bbox1
        self.bbox2 = bbox2
        self.loc1 = loc1
        self.loc2 = loc2
开发者ID:QuLogic,项目名称:matplotlib,代码行数:46,代码来源:inset_locator.py

示例3: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
    def __init__(self, bbox, **kwargs):
        """
        Patch showing the shape bounded by a Bbox.

        Parameters
        ----------
        bbox : `matplotlib.transforms.Bbox`
            Bbox to use for the extents of this patch.

        **kwargs
            Patch properties. Valid arguments include:
            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
开发者ID:dopplershift,项目名称:matplotlib,代码行数:21,代码来源:inset_locator.py

示例4: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
 def __init__(self, xy, radius, **kwargs):
     """
     xy : array_like
       center of two circles
     radius : scalar
       size of each circle
       
     Valid kwargs are:
     %(Patch)s
     """
     Patch.__init__(self, **kwargs)
     self.center = xy
     self.radius = radius
     self.width = 4. # two x unit circle (i.e. from +1 to -1)
     self.height = 2. # one x unit circle
     path = copy(Path.unit_circle())
     n_pts = path.vertices.shape[0]
     path.vertices = np.tile(path.vertices, [2,1])
     path.vertices[:n_pts,0] -= 1
     path.vertices[n_pts:,0] += 1
     path.codes = np.tile(path.codes, [2])
     self._path = path
     # Note: This cannot be calculated until this is added to an Axes
     self._patch_transform = transforms.IdentityTransform()
开发者ID:amcmorl,项目名称:amcmorl-py-tools,代码行数:26,代码来源:split_lambert_projection.py

示例5: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
 def __init__(self, path, **kwargs):
     zs = kwargs.pop('zs', [])
     zdir = kwargs.pop('zdir', 'z')
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
开发者ID:Aharobot,项目名称:matplotlib,代码行数:7,代码来源:art3d.py

示例6: __init__

# 需要导入模块: from matplotlib.patches import Patch [as 别名]
# 或者: from matplotlib.patches.Patch import __init__ [as 别名]
 def __init__(self, path, *, zs=(), zdir='z', **kwargs):
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
开发者ID:dopplershift,项目名称:matplotlib,代码行数:5,代码来源:art3d.py


注:本文中的matplotlib.patches.Patch.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。