MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / composite_transform_factory

Function composite_transform_factory

lib/matplotlib/transforms.py:2558–2582  ·  view source on GitHub ↗

Create a new composite transform that is the result of applying transform a then transform b. Shortcut versions of the blended transform are provided for the case where both child transforms are affine, or one or the other is the identity transform. Composite transforms ma

(a, b)

Source from the content-addressed store, hash-verified

2556
2557
2558def composite_transform_factory(a, b):
2559 """
2560 Create a new composite transform that is the result of applying
2561 transform a then transform b.
2562
2563 Shortcut versions of the blended transform are provided for the
2564 case where both child transforms are affine, or one or the other
2565 is the identity transform.
2566
2567 Composite transforms may also be created using the '+' operator,
2568 e.g.::
2569
2570 c = a + b
2571 """
2572 # check to see if any of a or b are IdentityTransforms. We use
2573 # isinstance here to guarantee that the transforms will *always*
2574 # be IdentityTransforms. Since TransformWrappers are mutable,
2575 # use of equality here would be wrong.
2576 if isinstance(a, IdentityTransform):
2577 return b
2578 elif isinstance(b, IdentityTransform):
2579 return a
2580 elif isinstance(a, Affine2D) and isinstance(b, Affine2D):
2581 return CompositeAffine2D(a, b)
2582 return CompositeGenericTransform(a, b)
2583
2584
2585class BboxTransform(Affine2DBase):

Callers 2

__add__Method · 0.85
frozenMethod · 0.85

Calls 2

CompositeAffine2DClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…