當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。