Skip to content

Commit c299457

Browse files
committed
Merge pull request matplotlib#3681 from jbmohler/use_fast_from_codes_and_verts
PRF : use _fast_from_codes_and_verts in transform code
2 parents 38d69b0 + 91725d8 commit c299457

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/transforms.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1380,8 +1380,9 @@ def transform_path_non_affine(self, path):
13801380
``transform_path(path)`` is equivalent to
13811381
``transform_path_affine(transform_path_non_affine(values))``.
13821382
"""
1383-
return Path(self.transform_non_affine(path.vertices), path.codes,
1384-
path._interpolation_steps)
1383+
x = self.transform_non_affine(path.vertices)
1384+
return Path._fast_from_codes_and_verts(x, path.codes,
1385+
{'interpolation_steps': path._interpolation_steps})
13851386

13861387
def transform_angles(self, angles, pts, radians=False, pushoff=1e-5):
13871388
"""
@@ -2587,8 +2588,8 @@ def _revalidate(self):
25872588
self._transformed_path = \
25882589
self._transform.transform_path_non_affine(self._path)
25892590
self._transformed_points = \
2590-
Path(self._transform.transform_non_affine(self._path.vertices),
2591-
None, self._path._interpolation_steps)
2591+
Path._fast_from_codes_and_verts(self._transform.transform_non_affine(self._path.vertices),
2592+
None, {'interpolation_steps': self._path._interpolation_steps})
25922593
self._invalid = 0
25932594

25942595
def get_transformed_points_and_affine(self):

0 commit comments

Comments
 (0)