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


Python Path.unit_circle方法代码示例

本文整理汇总了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() 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:27,代码来源:patches.py

示例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) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:7,代码来源:hatch.py

示例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) 
开发者ID:miloharper,项目名称:neural-network-animation,代码行数:9,代码来源:test_path.py

示例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) 
开发者ID:miloharper,项目名称:neural-network-animation,代码行数:9,代码来源:test_path.py

示例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() 
开发者ID:holzschu,项目名称:python3_ios,代码行数:10,代码来源:test_path.py

示例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) 
开发者ID:holzschu,项目名称:python3_ios,代码行数:10,代码来源:test_path.py


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