diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 0cecc46a1a24..a5b2a5aca2eb 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -1120,9 +1120,10 @@ def get_hatch_path(self, density=6.0): """ Returns a Path for the current hatch. """ - if self._hatch is None: + hatch = self.get_hatch() + if hatch is None: return None - return Path.hatch(self._hatch, density) + return Path.hatch(hatch, density) def get_hatch_color(self): """ @@ -1178,16 +1179,15 @@ def set_sketch_params(self, scale=None, length=None, randomness=None): length : float, optional The length of the wiggle along the line, in pixels - (default 128.0) + (default 128) randomness : float, optional The scale factor by which the length is shrunken or - expanded (default 16.0) + expanded (default 16) """ - if scale is None: - self._sketch = None - else: - self._sketch = (scale, length or 128.0, randomness or 16.0) + self._sketch = ( + None if scale is None + else (scale, length or 128., randomness or 16.)) class TimerBase(object): diff --git a/lib/matplotlib/patheffects.py b/lib/matplotlib/patheffects.py index d279c650c575..c0265ec71914 100644 --- a/lib/matplotlib/patheffects.py +++ b/lib/matplotlib/patheffects.py @@ -386,6 +386,8 @@ def draw_path(self, renderer, gc, tpath, affine, rgbFace): affine = self._offset_transform(renderer, affine) self.patch._path = tpath self.patch.set_transform(affine) - self.patch.set_clip_box(gc._cliprect) - self.patch.set_clip_path(gc._clippath) + self.patch.set_clip_box(gc.get_clip_rectangle()) + clip_path = gc.get_clip_path() + if clip_path: + self.patch.set_clip_path(*clip_path) self.patch.draw(renderer)