Initialize an Affine transform from a 3x3 numpy float array:: a c e b d f 0 0 1 If *matrix* is None, initialize with the identity transform.
(self, matrix=None, **kwargs)
| 1868 | """ |
| 1869 | |
| 1870 | def __init__(self, matrix=None, **kwargs): |
| 1871 | """ |
| 1872 | Initialize an Affine transform from a 3x3 numpy float array:: |
| 1873 | |
| 1874 | a c e |
| 1875 | b d f |
| 1876 | 0 0 1 |
| 1877 | |
| 1878 | If *matrix* is None, initialize with the identity transform. |
| 1879 | """ |
| 1880 | Affine2DBase.__init__(self, **kwargs) |
| 1881 | if matrix is None: |
| 1882 | # A bit faster than np.identity(3). |
| 1883 | matrix = IdentityTransform._mtx.copy() |
| 1884 | self._mtx = matrix |
| 1885 | self._invalid = 0 |
| 1886 | |
| 1887 | def __str__(self): |
| 1888 | return ("{}(\n" |