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

Skip to content

Commit e39e3cf

Browse files
ksundentimhoffm
andcommitted
Rename annotate parameter to match upstream
Run boilerplate.py change version rename takes effect Co-Authored-By: Thomas A Caswell <[email protected]> Release note of variable change Rebased onto newer master Address doc building Apply suggested language change for release note Co-Authored-By: Tim Hoffmann <[email protected]>
1 parent 54b4263 commit e39e3cf

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Changes in parameter names
2+
``````````````````````````
3+
4+
The parameter ``s`` to `.Axes.annotate` and `.pyplot.annotate` is renamed to
5+
``text``, matching `.Annotation`.
6+
7+
The old parameter name remains supported for `.Axes.annotate`, but
8+
support for it will be dropped in a future Matplotlib release.

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,10 @@ def text(self, x, y, s, fontdict=None, **kwargs):
753753
self._add_text(t)
754754
return t
755755

756+
@cbook._rename_parameter("3.2", "s", "text")
756757
@docstring.dedent_interpd
757-
def annotate(self, s, xy, *args, **kwargs):
758-
a = mtext.Annotation(s, xy, *args, **kwargs)
758+
def annotate(self, text, xy, *args, **kwargs):
759+
a = mtext.Annotation(text, xy, *args, **kwargs)
759760
a.set_transform(mtransforms.IdentityTransform())
760761
if 'clip_on' in kwargs:
761762
a.set_clip_path(self.patch)

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,8 +2254,8 @@ def angle_spectrum(
22542254

22552255
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
22562256
@_copy_docstring_and_deprecators(Axes.annotate)
2257-
def annotate(s, xy, *args, **kwargs):
2258-
return gca().annotate(s, xy, *args, **kwargs)
2257+
def annotate(text, xy, *args, **kwargs):
2258+
return gca().annotate(text, xy, *args, **kwargs)
22592259

22602260

22612261
# Autogenerated by boilerplate.py. Do not edit as changes will be lost.

0 commit comments

Comments
 (0)