Subclasses of other Transform in matplotlib

2020-04-10 23:31:13-Edit by yangray 
BlendedGenericTransform is a subclass of Transform and supports the use of different transforms in the x / y direction. (Blogger translates to: mixed transformation)
CompositeGenericTransform is a subclass of Transform and supports two transformations at a time (continuous). (Blogger's self-translation: compound transformation)

BlendedGenericTransform(Transform):
方法:
  • __init__(self, x_transform, y_transform, **kwargs):

     Parameters [x_transform], [y_transform]: Transform object, transform in x / y direction.

    To initialize this transformation, use x_transform in the x direction and y_transform in the y direction.

  • contains_branch_seperately(self, transform):

     Parameter [transform]: Transform instance

     Returns whether transform is a subclass of x_transform / y_transform in this hybrid transformation. The return value looks like (True, False)

  •  depth (self): @property decorator

     Returns the maximum depth of [x_transform], [y_transform] (what is not known)

  • contains_branch(self, other):

     Returns False. (Transformation of two different classes cannot contain the same descendant class)

  •  _get_is_affine(self), _get_has_inverse(self):

     Returns whether the transformations in the x and y directions are both affine transformations / whether they all have inversion methods. (X, y are both True, otherwise are False)

  • frozen(self):

     Returns the static x and y transformation matrix in the form of tuples. (If both the x-direction transformation and the y-direction transformation are subclasses of Affine2DBase, use BlendedAffine2D to return; otherwise use BlendedGenericTransform)

  •  transform_non_affine(self, points):

     Parameter [points]: point set

    Returns the result of the non-affine transformation part that only transforms points in the x and y directions.

  • inverted(self):

     Returns the new BlendedGenericTransform (mixed transform) object that is initialized after x_transform and y_transform are inverted using their respective inversion methods .

  • get_affine(self):
    Returns the affine matrix in x_transform and y_transform. (The same result is returned) 



CompositeGenericTransform (Transform):
Method:
  • __init__(self, a, b, **kwargs):

     Parameters [a], [b]: Transform object

    Initialize the composite transformation, and save a and b as class attributes.

  •  frozen(self):

     Returns the transformation matrix of a and b in the form of a static tuple. (If transformations a and b are both subclasses of Affine2D, use CompositeAffine2D to return; otherwise use CompositeGenericTransform )

  • _invalidate_internal(self, value, invalidating_node):

     Parameter [value]: Invalidation target, optional INVALID_AFFINE, INVALID_NON_AFFINE or INVALID (INVALID_NON_AFFINE | INVALID_AFFINE), respectively affine part, non-affine part, all [ invalidating_node ]: node (object) that needs to be invalidated

    In some special cases, it is used when the invalidation of only the affine part needs to be extended to the non-affine part. The special case is that transformation b is non-affine and transformation a is also non-affine transformation or transformation a has been turned on to invalidate.

  • _iter_break_from_left_to_right(self):

   · (Do not understand)

  • depth(self):
     Returns the sum of the depths of changes a and b (do n’t know what it means)
  • _get_is_affine(self), _get_is_separable(self):

     Returns whether the transformations a and b are both affine transformations / both are separable (hybrid transformation). (True if ab is satisfied)

  • transform_affine(self, points), transform_non_affine(self, points):

     Parameter [points]: point set

    Returns the result of making only the affine part / non-affine part of this composite transformation for points .

  • transform_path_non_affine(self, path):

     Parameter [path]: Path object, which means curve

    Returns the result of performing the non-affine part of this composite transformation on path.

  • get_affine(self):

     Returns the matrix of the affine part of this composite transformation. (If the transformation b is non-affine, then return the affine matrix of b (False); otherwise, change the dot product of the affine matrix of b and transformation a).

  • inverted(self):

     Return a new CompositeGenericTransform (composite transform) object that transforms a and b using their respective inversion methods and then inverts them .

  •  _get_has_inverse(self):
    Returns whether transformations a and b both have inversion methods. (Both True)

Guess you like

Origin www.cnblogs.com/exploer/p/12674855.html