本文整理汇总了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
示例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
示例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
示例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()
示例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)
示例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)