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


Python Bbox.from_extents方法代码示例

本文整理汇总了Python中transforms.Bbox.from_extents方法的典型用法代码示例。如果您正苦于以下问题:Python Bbox.from_extents方法的具体用法?Python Bbox.from_extents怎么用?Python Bbox.from_extents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在transforms.Bbox的用法示例。


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

示例1: get_path_collection_extents

# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import from_extents [as 别名]
def get_path_collection_extents(
        master_transform, paths, transforms, offsets, offset_transform):
    """
    Given a sequence of :class:`Path` objects,
    :class:`~matplotlib.transforms.Transform` objects and offsets, as
    found in a :class:`~matplotlib.collections.PathCollection`,
    returns the bounding box that encapsulates all of them.

    *master_transform* is a global transformation to apply to all paths

    *paths* is a sequence of :class:`Path` instances.

    *transforms* is a sequence of
    :class:`~matplotlib.transforms.Affine2D` instances.

    *offsets* is a sequence of (x, y) offsets (or an Nx2 array)

    *offset_transform* is a :class:`~matplotlib.transforms.Affine2D`
    to apply to the offsets before applying the offset to the path.

    The way that *paths*, *transforms* and *offsets* are combined
    follows the same method as for collections.  Each is iterated over
    independently, so if you have 3 paths, 2 transforms and 1 offset,
    their combinations are as follows:

        (A, A, A), (B, B, A), (C, A, A)
    """
    from transforms import Bbox
    if len(paths) == 0:
        raise ValueError("No paths provided")
    return Bbox.from_extents(*_get_path_collection_extents(
        master_transform, paths, transforms, offsets, offset_transform))
开发者ID:AmitAronovitch,项目名称:matplotlib,代码行数:34,代码来源:path.py

示例2: get_path_collection_extents

# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import from_extents [as 别名]
def get_path_collection_extents(*args):
    """
    Given a sequence of :class:`Path` objects, returns the bounding
    box that encapsulates all of them.
    """
    from transforms import Bbox
    if len(args[1]) == 0:
        raise ValueError("No paths provided")
    return Bbox.from_extents(*_get_path_collection_extents(*args))
开发者ID:zoccolan,项目名称:eyetracker,代码行数:11,代码来源:path.py

示例3: get_paths_extents

# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import from_extents [as 别名]
def get_paths_extents(paths, transforms=[]):
    """
    Given a sequence of :class:`Path` objects and optional
    :class:`~matplotlib.transforms.Transform` objects, returns the
    bounding box that encapsulates all of them.

    *paths* is a sequence of :class:`Path` instances.

    *transforms* is an optional sequence of
    :class:`~matplotlib.transforms.Affine2D` instances to apply to
    each path.
    """
    from transforms import Bbox, Affine2D
    if len(paths) == 0:
        raise ValueError("No paths provided")
    return Bbox.from_extents(*_get_path_collection_extents(
        Affine2D(), paths, transforms, [], Affine2D()))
开发者ID:AmitAronovitch,项目名称:matplotlib,代码行数:19,代码来源:path.py


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