Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 855d343

Browse files
committed
Made the Path created by cleared consistent with the actions that have taken place.
1 parent 5218f47 commit 855d343

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

lib/matplotlib/path.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,26 +165,27 @@ def _fast_from_codes_and_verts(cls, verts, codes, internals=None):
165165
"""
166166
Creates a Path instance without the expense of calling the constructor
167167
168-
Use this method at your own risk...
169-
170168
Parameters
171169
----------
172170
verts : numpy array
173171
codes : numpy array (may not be None)
174172
internals : dict or None
175173
The attributes that the resulting path should have.
174+
Allowed keys are ``readonly``, ``should_simplify``,
175+
``simplify_threshold``, ``has_nonfinite`` and
176+
``interpolation_steps``.
176177
177178
"""
178179
internals = internals or {}
179180
pth = cls.__new__(cls)
180181
pth._vertices = verts
181182
pth._codes = codes
182-
pth._readonly = internals.pop('_readonly', False)
183-
pth._should_simplify = internals.pop('_should_simplify', True)
184-
pth._simplify_threshold = internals.pop('_simplify_threshold',
183+
pth._readonly = internals.pop('readonly', False)
184+
pth.should_simplify = internals.pop('should_simplify', True)
185+
pth.simplify_threshold = internals.pop('simplify_threshold',
185186
rcParams['path.simplify_threshold'])
186-
pth._has_nonfinite = internals.pop('_has_nonfinite', False)
187-
pth._interpolation_steps = internals.pop('_interpolation_steps', 1)
187+
pth._has_nonfinite = internals.pop('has_nonfinite', False)
188+
pth._interpolation_steps = internals.pop('interpolation_steps', 1)
188189
if internals:
189190
raise ValueError('Unexpected internals provided to '
190191
'_fast_from_codes_and_verts: '
@@ -436,7 +437,11 @@ def cleaned(self, transform=None, remove_nans=False, clip=None,
436437
remove_nans, clip,
437438
snap, stroke_width,
438439
simplify, curves, sketch)
439-
return Path._fast_from_codes_and_verts(vertices, codes)
440+
internals = {'should_simplify': self.should_simplify and not simplify,
441+
'has_nonfinite': self.has_nonfinite and not remove_nans,
442+
'simplify_threshold': self.simplify_threshold,
443+
'interpolation_steps': self._interpolation_steps}
444+
return Path._fast_from_codes_and_verts(vertices, codes, internals)
440445

441446
def transformed(self, transform):
442447
"""

0 commit comments

Comments
 (0)