本文整理匯總了Python中matplotlib.path.Path.unit_circle方法的典型用法代碼示例。如果您正苦於以下問題:Python Path.unit_circle方法的具體用法?Python Path.unit_circle怎麽用?Python Path.unit_circle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類matplotlib.path.Path
的用法示例。
在下文中一共展示了Path.unit_circle方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def __init__(self, xy, width, height, angle=0.0, **kwargs):
"""
*xy*
center of ellipse
*width*
total length (diameter) of horizontal axis
*height*
total length (diameter) of vertical axis
*angle*
rotation in degrees (anti-clockwise)
Valid kwargs are:
%(Patch)s
"""
Patch.__init__(self, **kwargs)
self.center = xy
self.width, self.height = width, height
self.angle = angle
self._path = Path.unit_circle()
# Note: This cannot be calculated until this is added to an Axes
self._patch_transform = transforms.IdentityTransform()
示例2: __init__
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def __init__(self, hatch, density):
path = Path.unit_circle()
self.shape_vertices = path.vertices
self.shape_codes = path.codes
Shapes.__init__(self, hatch, density)
示例3: test_readonly_path
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def test_readonly_path():
path = Path.unit_circle()
def modify_vertices():
path.vertices = path.vertices * 2.0
assert_raises(AttributeError, modify_vertices)
示例4: test_contains_points_negative_radius
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def test_contains_points_negative_radius():
path = Path.unit_circle()
points = [(0.0, 0.0), (1.25, 0.0), (0.9, 0.9)]
expected = [True, False, False]
assert np.all(path.contains_points(points, radius=-0.5) == expected)
示例5: test_readonly_path
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def test_readonly_path():
path = Path.unit_circle()
def modify_vertices():
path.vertices = path.vertices * 2.0
with pytest.raises(AttributeError):
modify_vertices()
示例6: test_contains_points_negative_radius
# 需要導入模塊: from matplotlib.path import Path [as 別名]
# 或者: from matplotlib.path.Path import unit_circle [as 別名]
def test_contains_points_negative_radius():
path = Path.unit_circle()
points = [(0.0, 0.0), (1.25, 0.0), (0.9, 0.9)]
expected = [True, False, False]
result = path.contains_points(points, radius=-0.5)
assert np.all(result == expected)