zoukankan      html  css  js  c++  java
  • matplotlib Transform

    2020-04-09 15:09:02 -- Edit by yangray

    Transform 类是TransformNode的子类,它是所有执行变换的TransformNode的实例的基类。所有非仿射变换都应是Transform的子类。(仿射变化都应是Affine2D的子类)

    方法:

    • _iter_break_from_left_to_right():
    • depth():

        返回 合成本bbox的变换的数量。(该方法适用于 复合变换, 最大的深度将被返回)

    • contains_branch(other):

        参数[other]: Transform实例

        返回 other是否是本transform的子类。是子类为True,不是为False。

    • contains_branch_seperately(other_transform):

        参数[other]: Transform实例。

        返回 other是否在每个维度上都是本transform的子类。是子类为True,不是为False。Ex: [True, True]

    • __array__(*args, **kwargs):

        返回仿射矩阵,3*3 numpy数组。

    • transform(values):

        参数 [values]: n维数组(最大为2维)

        返回 values执行本变换之后的数组。(即先执行非仿射变换后执行仿射变换)

    • transform_affine(values), transform_non_affine(values):

        参数同上一函数

        返回 values仅执行仿射/非仿射变化后的数组。

    • transform_bbox(bbox):

        参数 [bbox]: Bbox实例

        返回 bbox进行本变换之后的新bbox实例。

    • get_affine():

        返回 本变换中的仿射变换部分。(一个 IdentityTransform实例)。

    • get_matrix():

        返回仿射矩阵。(一个3*3矩阵)

    • transform_point(point):

        参数[point]: 点坐标对。Ex: (2, 3)

        返回point执行本变换之后的新点。

    •  transform_path(path):

        参数[path]: matplotlib.path.Path实例,意为路径,线

        返回path执行仿射变化之后的新path(路径)。

    •  transform_path_affine(path), transform_path_non_affine(path):

        参数同上一函数

        返回path仅执行仿射 / 非仿射变化后的新path(路径)。

    • transform_angles(angles, pts, radians=False, pushoff=1e-5):

        参数[angles]: 列向量 

          [pts]: 形式为n*2的数组,行数必须与angles行数一致

          [radians]: 用于标记输入的角度(angles)是弧度制还是角度制,True为弧度,False为角度(默认)

          [pushoff]: (尚不明了,貌似用于描述角度间距)

        返回对角度(angles)执行本变换之后的新角度。(形式为列向量)

    • inverted(self):

        抽象方法(子类必需重写该方法)。(具体的反转bbox方法)

  • 相关阅读:
    项目成本管理(三)
    项目成本管理(二)
    项目成本管理(一)
    男士香水
    荷兰猛兽-梅尔文训练体能
    PP学习笔记-业务基础
    SAP入行就业
    PP学习笔记02
    BZOJ 3012: [Usaco2012 Dec]First! 字典树 + tarjan
    CF319E Ping-Pong 线段树 + vector + 思维
  • 原文地址:https://www.cnblogs.com/exploer/p/12667092.html
Copyright © 2011-2022 走看看