• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python patches.Patch类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

    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,代码行数:7,代码来源:inset_locator.py


示例2: set_3d_properties

    def set_3d_properties(self, verts, zs=0, zdir='z'):
        if not iterable(zs):
            zs = np.ones(len(verts)) * zs

        self._segment3d = [juggle_axes(x, y, z, zdir) \
                for ((x, y), z) in zip(verts, zs)]
        self._facecolor3d = Patch.get_facecolor(self)
开发者ID:Aharobot,项目名称:matplotlib,代码行数:7,代码来源:art3d.py


示例3: __init__

    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,代码行数:44,代码来源:inset_locator.py


示例4: __init__

    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,代码行数:19,代码来源:inset_locator.py


示例5: __init__

 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,代码行数:24,代码来源:split_lambert_projection.py


示例6: __init__

 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,代码行数:5,代码来源:art3d.py


示例7: draw

 def draw(self, renderer):
     Patch.draw(self, renderer)
开发者ID:Aharobot,项目名称:matplotlib,代码行数:2,代码来源:art3d.py


示例8: set_3d_properties

 def set_3d_properties(self, verts, zs=0, zdir='z'):
     zs = np.broadcast_to(zs, len(verts))
     self._segment3d = [juggle_axes(x, y, z, zdir)
                        for ((x, y), z) in zip(verts, zs)]
     self._facecolor3d = Patch.get_facecolor(self)
开发者ID:magnunor,项目名称:matplotlib,代码行数:5,代码来源:art3d.py


示例9: __init__

 def __init__(self, path, *, zs=(), zdir='z', **kwargs):
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
开发者ID:dopplershift,项目名称:matplotlib,代码行数:3,代码来源:art3d.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python patches.PathPatch类代码示例发布时间:2022-05-27
下一篇:
Python patches.FancyBboxPatch类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap