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

Skip to content

Commit 80c884a

Browse files
committed
Merge pull request #6464 from tacaswell/doc_annotation_docstrings
DOC: update annotation docstrings
2 parents ec276e2 + e89d32d commit 80c884a

File tree

2 files changed

+191
-157
lines changed

2 files changed

+191
-157
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -633,63 +633,13 @@ def text(self, x, y, s, fontdict=None,
633633

634634
@docstring.dedent_interpd
635635
def annotate(self, *args, **kwargs):
636-
"""
637-
Create an annotation: a piece of text referring to a data
638-
point.
639-
640-
Parameters
641-
----------
642-
s : string
643-
label
644-
645-
xy : (x, y)
646-
position of element to annotate. See *xycoords* to control what
647-
coordinate system this value is interpretated in.
648-
649-
xytext : (x, y) , optional, default: None
650-
position of the label `s`. See *textcoords* to control what
651-
coordinate system this value is interpreted in.
652-
653-
xycoords : string, optional, default: "data"
654-
string that indicates what type of coordinates `xy` is. Examples:
655-
"figure points", "figure pixels", "figure fraction", "axes
656-
points", .... See `matplotlib.text.Annotation` for more details.
657-
658-
textcoords : string, optional, default: None
659-
string that indicates what type of coordinates `text` is. Examples:
660-
"figure points", "figure pixels", "figure fraction", "axes
661-
points", .... See `matplotlib.text.Annotation` for more details.
662-
663-
arrowprops : `matplotlib.lines.Line2D` properties, optional
664-
Dictionary of line properties for the arrow that connects
665-
the annotation to the point. If the dictionnary has a key
666-
`arrowstyle`, a `~matplotlib.patches.FancyArrowPatch`
667-
instance is created and drawn. See
668-
`matplotlib.text.Annotation` for more details on valid
669-
options. Default is None.
670-
671-
Returns
672-
-------
673-
a : `~matplotlib.text.Annotation`
674-
675-
676-
Notes
677-
-----
678-
679-
%(Annotation)s
680-
681-
Examples
682-
--------
683-
684-
.. plot:: mpl_examples/pylab_examples/annotation_demo2.py
685-
"""
686636
a = mtext.Annotation(*args, **kwargs)
687637
a.set_transform(mtransforms.IdentityTransform())
688638
if 'clip_on' in kwargs:
689639
a.set_clip_path(self.patch)
690640
self._add_text(a)
691641
return a
692-
642+
annotate.__doc__ = mtext.Annotation.__init__.__doc__
693643
#### Lines and spans
694644

695645
@docstring.dedent_interpd

0 commit comments

Comments
 (0)