Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DOC: update annotation docstrings #6464

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 1 addition & 51 deletions 52 lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,63 +633,13 @@ def text(self, x, y, s, fontdict=None,

@docstring.dedent_interpd
def annotate(self, *args, **kwargs):
"""
Create an annotation: a piece of text referring to a data
point.

Parameters
----------
s : string
label

xy : (x, y)
position of element to annotate. See *xycoords* to control what
coordinate system this value is interpretated in.

xytext : (x, y) , optional, default: None
position of the label `s`. See *textcoords* to control what
coordinate system this value is interpreted in.

xycoords : string, optional, default: "data"
string that indicates what type of coordinates `xy` is. Examples:
"figure points", "figure pixels", "figure fraction", "axes
points", .... See `matplotlib.text.Annotation` for more details.

textcoords : string, optional, default: None
string that indicates what type of coordinates `text` is. Examples:
"figure points", "figure pixels", "figure fraction", "axes
points", .... See `matplotlib.text.Annotation` for more details.

arrowprops : `matplotlib.lines.Line2D` properties, optional
Dictionary of line properties for the arrow that connects
the annotation to the point. If the dictionnary has a key
`arrowstyle`, a `~matplotlib.patches.FancyArrowPatch`
instance is created and drawn. See
`matplotlib.text.Annotation` for more details on valid
options. Default is None.

Returns
-------
a : `~matplotlib.text.Annotation`


Notes
-----

%(Annotation)s

Examples
--------

.. plot:: mpl_examples/pylab_examples/annotation_demo2.py
"""
a = mtext.Annotation(*args, **kwargs)
a.set_transform(mtransforms.IdentityTransform())
if 'clip_on' in kwargs:
a.set_clip_path(self.patch)
self._add_text(a)
return a

annotate.__doc__ = mtext.Annotation.__init__.__doc__
#### Lines and spans

@docstring.dedent_interpd
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.