matplotlib
Fork me on GitHub


Travis-CI:

Table Of Contents

This Page

matplotlib.pyplot.figtext

matplotlib.pyplot.figtext(*args, **kwargs)

Add text to figure.

Call signature:

text(x, y, s, fontdict=None, **kwargs)

Add text to figure at location x, y (relative 0-1 coords). See text() for the meaning of the other arguments.

kwargs control the Text properties:

Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha float (0.0 transparent through 1.0 opaque)
animated bool
backgroundcolor any matplotlib color
bbox FancyBboxPatch prop dict
clip_box a matplotlib.transforms.Bbox instance
clip_on [True | False]
clip_path [ (Path, Transform) | Patch | None ]
color any matplotlib color
contains a callable function
family or fontfamily or fontname or name [FONTNAME | ‘serif’ | ‘sans-serif’ | ‘cursive’ | ‘fantasy’ | ‘monospace’ ]
figure a Figure instance
fontproperties or font_properties a matplotlib.font_manager.FontProperties instance
gid an id string
horizontalalignment or ha [ ‘center’ | ‘right’ | ‘left’ ]
label object
linespacing float (multiple of font size)
multialignment or ma [‘left’ | ‘right’ | ‘center’ ]
path_effects AbstractPathEffect
picker [None | bool | float | callable]
position (x,y)
rasterized bool or None
rotation [ angle in degrees | ‘vertical’ | ‘horizontal’ ]
rotation_mode [ None | “default” | “anchor” ]
size or fontsize [size in points | ‘xx-small’ | ‘x-small’ | ‘small’ | ‘medium’ | ‘large’ | ‘x-large’ | ‘xx-large’ ]
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
stretch or fontstretch [a numeric value in range 0-1000 | ‘ultra-condensed’ | ‘extra-condensed’ | ‘condensed’ | ‘semi-condensed’ | ‘normal’ | ‘semi-expanded’ | ‘expanded’ | ‘extra-expanded’ | ‘ultra-expanded’ ]
style or fontstyle [ ‘normal’ | ‘italic’ | ‘oblique’]
text string or anything printable with ‘%s’ conversion.
transform Transform
url a url string
usetex bool or None
variant or fontvariant [ ‘normal’ | ‘small-caps’ ]
verticalalignment or va [ ‘center’ | ‘top’ | ‘bottom’ | ‘baseline’ ]
visible bool
weight or fontweight [a numeric value in range 0-1000 | ‘ultralight’ | ‘light’ | ‘normal’ | ‘regular’ | ‘book’ | ‘medium’ | ‘roman’ | ‘semibold’ | ‘demibold’ | ‘demi’ | ‘bold’ | ‘heavy’ | ‘extra bold’ | ‘black’ ]
wrap bool
x float
y float
zorder float

Examples using matplotlib.pyplot.figtext