[python] annotation in a figure

  • annotate

1. annotate

.annotate()creates an annotation: a piece of text referring to

a data point.
Usage:
figure.annotate(s=annotation, xy=(x1, y1), xycoords='data',
xytext=(x2, y2), textcoords='offset points',...)

common used parameters:

  • s: string, text information as annotation.
  • xy: (x,y) position to put the annotation
  • xytext: (x,y), optional, default=None. Position of label s.
  • xycoords: string, optional, default=”data”. String indicates what type of coordinates xy is.
  • textcoords: string, optional, default=None. String indicates what type of coordinates text is.
  • arrowprops: optional. If it is not none, it is a dictionary of line properties for the arrow that connects the annotation to the point. An arrow connecting two point (xy & xytext) can be optionally drawn by specifying the arrowprops argument.

Application can be found in

你可能感兴趣的:(python)