Logo Search packages:      
Sourcecode: matplotlib version File versions

pylab_examples::annotation_demo Namespace Reference


Detailed Description

Some examples of how to annotate points in figures.  You specify an
annotation point xy=(x,y) and a text point xytext=(x,y) for the
annotated points and text location, respectively.  Optionally, you can
specify the coordinate system of xy and xytext with one of the
following strings for xycoords and textcoords (default is 'data')


  'figure points'   : points from the lower left corner of the figure
  'figure pixels'   : pixels from the lower left corner of the figure
  'figure fraction' : 0,0 is lower left of figure and 1,1 is upper, right
  'axes points'     : points from lower left corner of axes
  'axes pixels'     : pixels from lower left corner of axes
  'axes fraction'   : 0,1 is lower left of axes and 1,1 is upper right
  'offset points'   : Specify an offset (in points) from the xy value
  'data'            : use the axes data coordinate system

Optionally, you can specify arrow properties which draws and arrow
from the text to the annotated point by giving a dictionary of arrow
properties

Valid keys are

      width : the width of the arrow in points
      frac  : the fraction of the arrow length occupied by the head
      headwidth : the width of the base of the arrow head in points
      shrink : move the tip and base some percent away from the
               annotated point and text
      any key for matplotlib.patches.polygon  (eg facecolor)

For physical coordinate systems (points or pixels) the origin is the
(bottom, left) of the figure or axes.  If the value is negative,
however, the origin is from the (right, top) of the figure or axes,
analogous to negative indexing of sequences.


Variables

tuple arrowprops = dict(facecolor='black', shrink=0.05)
tuple ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5))
 clip_on = True,
tuple el = Ellipse((0,0), 10, 20, facecolor='r', alpha=0.5)
tuple fig = figure()
int fontsize = 20
string horizontalalignment = 'center'
int ind = 800
tuple r = np.arange(0,1,0.001)
tuple s = np.cos(2*np.pi*t)
tuple t = np.arange(0.0, 5.0, 0.01)
string textcoords = 'figure fraction'
int theta = 2
string verticalalignment = 'bottom'
tuple xy = (thistheta, thisr)
string xycoords = 'figure fraction'
tuple xytext = (-15, 10)


Generated by  Doxygen 1.6.0   Back to index