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

Skip to content

Commit d2dd649

Browse files
committed
Merge pull request #2208 from NelleV/MEP10_annotate
DOC annotate is now in numpydoc format
2 parents 3597917 + 9e3c35e commit d2dd649

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,47 @@ def annotate(self, *args, **kwargs):
537537
Create an annotation: a piece of text referring to a data
538538
point.
539539
540-
Call signature::
540+
Parameters
541+
----------
542+
s : string
543+
label
541544
542-
annotate(s, xy, xytext=None, xycoords='data',
543-
textcoords='data', arrowprops=None, **kwargs)
545+
xy : (x, y)
546+
position of element to annotate
544547
545-
Keyword arguments:
548+
xytext : (x, y) , optional, default: None
549+
position of the label `s`
550+
551+
xycoords : string, optional, default: "data"
552+
string that indicates what tye of coordinates `xy` is. Examples:
553+
"figure points", "figure pixels", "figure fraction", "axes
554+
points", .... See `matplotlib.text.Annotation` for more details.
555+
556+
textcoords : string, optional, default: None
557+
string that indicates what type of coordinates `text` is. Examples:
558+
"figure points", "figure pixels", "figure fraction", "axes
559+
points", .... See `matplotlib.text.Annotation` for more details.
560+
561+
arrowprops : `matplotlib.lines.Line2D` properties, optional, default: None
562+
Dictionnary of line properties for the arrow that connects the
563+
annotation to the point. If the dictionnary has a key
564+
`arrowstyle`, a `FancyArrowPatch` instance is created and drawn.
565+
See `matplotlib.text.Annotation` for more details on valid
566+
options.
567+
568+
Returns
569+
-------
570+
a : `~matplotlib.text.Annotation`
571+
572+
573+
Other parameters
574+
-----------------
546575
547576
%(Annotation)s
548577
578+
Examples
579+
--------
580+
549581
.. plot:: mpl_examples/pylab_examples/annotation_demo2.py
550582
"""
551583
a = mtext.Annotation(*args, **kwargs)
@@ -710,7 +742,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
710742
Return value is a :class:`matplotlib.patches.Polygon`
711743
instance.
712744
713-
Examples:
745+
Examples:
714746
715747
* draw a gray rectangle from *y* = 0.25-0.75 that spans the
716748
horizontal extent of the axes::

0 commit comments

Comments
 (0)