Skip to content

Annotation change from "s" to "text" in 3.0- documentation #12325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jason-neal opened this issue Sep 28, 2018 · 3 comments
Closed

Annotation change from "s" to "text" in 3.0- documentation #12325

jason-neal opened this issue Sep 28, 2018 · 3 comments
Milestone

Comments

@jason-neal
Copy link
Contributor

Bug report

Bug summary
Annotation argument has changed from 2.2.3 to 3.0 but I do not think it has been fully documented.

The documentation here is not to date with s still the keyword shown in parameter list (although it has text in the definition) https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.annotate.html#matplotlib.axes.Axes.annotate

Code for reproduction

#!/usr/bin/env python
import matplotlib
import sys
print(sys.version)
print(matplotlib.__version__)
import matplotlib.pyplot as plt

plt.figure()
a = plt.annotate(s="test", xy=(0.5, 0.5))
print(a)

Actual outcome
Here is the outcome in two different version of matplotlib.

/home/jneal/miniconda3/envs/py36/bin/python /home/jneal/Phd/Codes/annotatetest.py
3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
[GCC 7.2.0]
2.2.3
Annotation(0.5,0.5,'test')

Process finished with exit code 0

and

3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
[GCC 7.2.0]
3.0.0
Traceback (most recent call last):
  File "annotatetest.py", line 10, in <module>
    a = plt.annotate(s="test", xy=(0.5, 0.5))
TypeError: annotate() missing 1 required positional argument: 'text'

Expected outcome
I did not expect it to have changed.

If I change s to text then I have the same problem in reverse if trying to use both versions
( I do know that the arg name can be omitted)

Matplotlib version
conda installed matplotlib from conda-forge

@jklymak jklymak added this to the v3.0.x milestone Sep 28, 2018
@jklymak
Copy link
Member

jklymak commented Sep 28, 2018

This was #10830 @timhoffm is there a way to make text and s both work, or should we just use s. The docs indeed say s...

@anntzer
Copy link
Contributor

anntzer commented Oct 1, 2018

Actually I would propose to revert the specific change to annotate in #10830 to switch back to s only; it doesn't make sense to have different kwarg names to annotate() and to text().

@timhoffm
Copy link
Member

timhoffm commented Oct 1, 2018

Will care for this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants