diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 18f45ea5e7a9..2f98c9e5e171 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1205,7 +1205,7 @@ def get_valid_values(self, attr): match = self._get_valid_values_regex.search(docstring) if match is not None: - return match.group(1).replace('\n', ' ') + return re.sub("\n *", " ", match.group(1)) return 'unknown' def _get_setters_and_targets(self):