diff --git a/doc/api/next_api_changes/2018-11-19-AL.rst b/doc/api/next_api_changes/2018-11-19-AL.rst new file mode 100644 index 000000000000..44b01d3d3253 --- /dev/null +++ b/doc/api/next_api_changes/2018-11-19-AL.rst @@ -0,0 +1,5 @@ +Deprecations +```````````` + +The `TextPath` constructor used to silently drop ignored arguments; this +behavior is deprecated. diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index b07389c72931..539ed3d3831d 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -463,9 +463,13 @@ def __init__(self, xy, s, size=None, prop=None, Also see :doc:`/gallery/text_labels_and_annotations/demo_text_path`. """ + if kl or kwargs: + cbook.warn_deprecated( + "3.1", message="Additional agruments to TextPath used to be " + "ignored, but will trigger a TypeError %(removal)s.") + if prop is None: prop = FontProperties() - if size is None: size = prop.get_size_in_points() @@ -473,11 +477,8 @@ def __init__(self, xy, s, size=None, prop=None, self.set_size(size) self._cached_vertices = None - - self._vertices, self._codes = self.text_get_vertices_codes( - prop, s, - usetex=usetex) - + self._vertices, self._codes = \ + self.text_get_vertices_codes(prop, s, usetex=usetex) self._should_simplify = False self._simplify_threshold = rcParams['path.simplify_threshold'] self._has_nonfinite = False