30-04-2021



What does annotate mean? To provide critical or explanatory notes for (a literary work, etc.) (verb). Annotate with a highlighter and a pen or pencil. One of the easiest ways to annotate a book is to use a highlighter and pen or pencil directly on the text. Choose a highlighter in a shade that is easy for you to read on the page, such as a light blue or orange color. The standard yellow highlighter shade would also work too.

Annotate the point xy with text text.

In the simplest form, the text is placed at xy.

Optionally, the text can be displayed in another position xytext.An arrow pointing from the text to the annotated point xy can thenbe added by defining arrowprops.

Annotated Bibliography Example

Parameters:
textstr

The text of the annotation.

xy(float, float)

The point (x, y) to annotate. The coordinate system is determinedby xycoords.

xytext(float, float), default: xy

The position (x, y) to place the text at. The coordinate systemis determined by textcoords.

xycoordsstr or Artist or Transform or callable or (float, float), default: 'data'

The coordinate system that xy is given in. The following typesof values are supported:

  • One of the following strings:

    ValueDescription
    'figure points'Points from the lower left of the figure
    'figure pixels'Pixels from the lower left of the figure
    'figure fraction'Fraction of figure from lower left
    'subfigure points'Points from the lower left of the subfigure
    'subfigure pixels'Pixels from the lower left of the subfigure
    'subfigure fraction'Fraction of subfigure from lower left
    'axes points'Points from lower left corner of axes
    'axes pixels'Pixels from lower left corner of axes
    'axes fraction'Fraction of axes from lower left
    'data'Use the coordinate system of the objectbeing annotated (default)
    'polar'(theta, r) if not native 'data'coordinates

    Note that 'subfigure pixels' and 'figure pixels' are the samefor the parent figure, so users who want code that is usable ina subfigure can use 'subfigure pixels'.

  • An Artist: xy is interpreted as a fraction of the artist'sBbox. E.g. (0, 0) would be the lowerleft corner of the bounding box and (0.5, 1) would be thecenter top of the bounding box.

  • A Transform to transform xy to screen coordinates.

  • A function with one of the following signatures:

    where renderer is a RendererBase subclass.

    The result of the function is interpreted like the Artist andTransform cases above.

  • A tuple (xcoords, ycoords) specifying separate coordinatesystems for x and y. xcoords and ycoords must each beof one of the above described types.

See Advanced Annotations for more details.

textcoordsstr or Artist or Transform or callable or (float, float), default: value of xycoords

The coordinate system that xytext is given in.

All xycoords values are valid as well as the followingstrings:

ValueDescription
'offset points'Offset (in points) from the xy value
'offset pixels'Offset (in pixels) from the xy value
arrowpropsdict, optional

The properties used to draw a FancyArrowPatch arrow between thepositions xy and xytext. Note that the edge of the arrowpointing to xytext will be centered on the text itself and maynot point directly to the coordinates given in xytext.

If arrowprops does not contain the key 'arrowstyle' theallowed keys are:

KeyDescription
widthThe width of the arrow in points
headwidthThe width of the base of the arrow head in points
headlengthThe length of the arrow head in points
shrinkFraction of total length to shrink from both ends
?Any key to matplotlib.patches.FancyArrowPatch

If arrowprops contains the key 'arrowstyle' theabove keys are forbidden. The allowed values of'arrowstyle' are:

NameAttrs
'-'None
'->'head_length=0.4,head_width=0.2
'-['widthB=1.0,lengthB=0.2,angleB=None
'|-|'widthA=1.0,widthB=1.0
'-|>'head_length=0.4,head_width=0.2
'<-'head_length=0.4,head_width=0.2
'<->'head_length=0.4,head_width=0.2
'<|-'head_length=0.4,head_width=0.2
'<|-|>'head_length=0.4,head_width=0.2
'fancy'head_length=0.4,head_width=0.4,tail_width=0.4
'simple'head_length=0.5,head_width=0.5,tail_width=0.2
'wedge'tail_width=0.3,shrink_factor=0.5

Valid keys for FancyArrowPatch are:

KeyDescription
arrowstylethe arrow style
connectionstylethe connection style
relposdefault is (0.5, 0.5)
patchAdefault is bounding box of the text
patchBdefault is None
shrinkAdefault is 2 points
shrinkBdefault is 2 points
mutation_scaledefault is text size (in points)
mutation_aspectdefault is 1.
?any key for matplotlib.patches.PathPatch

Defaults to None, i.e. no arrow is drawn.

annotation_clipbool or None, default: None

Whether to draw the annotation when the annotation point xy isoutside the axes area.

  • If True, the annotation will only be drawn when xy iswithin the axes.
  • If False, the annotation will always be drawn.
  • If None, the annotation will only be drawn when xy iswithin the axes and xycoords is 'data'.
**kwargs

Additional kwargs are passed to Text.

Returns:
Annotation

Annotated Bibliography Apa Format

See also

Bibliography

Annotated Bibliography Example

Advanced Annotations