diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 2d225a3123ce..8b0bc695d213 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -837,7 +837,12 @@ def get_clip_path(self): an affine transform to apply to the path before clipping. """ if self._clippath is not None: - return self._clippath.get_transformed_path_and_affine() + tpath, tr = self._clippath.get_transformed_path_and_affine() + if np.all(np.isfinite(tpath.vertices)): + return tpath, tr + else: + _log.warning("Ill-defined clip_path detected. Returning None.") + return None, None return None, None def get_dashes(self):