matplotlib.pyplot.figtext#

matplotlib.pyplot.figtext(x,y,s,fontdict=None,**kwargs)[source]#

Add text to figure.

Parameters:
x, yfloat

The position to place the text. By default, this is in figurecoordinates, floats in [0, 1]. The coordinate system can be changedusing thetransform keyword.

sstr

The text string.

fontdictdict, optional

A dictionary to override the default text properties. If not given,the defaults are determined byrcParams["font.*"]. Properties passed askwargs override the corresponding ones given infontdict.

Returns:
Text
Other Parameters:
**kwargsText properties

Other miscellaneous text parameters.

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 and two offsets from the bottom left corner of the image

alpha

float or None

animated

bool

antialiased

bool

backgroundcolor

color

bbox

dict with properties forFancyBboxPatch or None

clip_box

unknown

clip_on

unknown

clip_path

unknown

color orc

color

figure

Figure orSubFigure

fontfamily orfamily orfontname

{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}

fontproperties orfont orfont_properties

font_manager.FontProperties orstr orpathlib.Path

fontsize orsize

float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}

fontstretch orstretch

{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}

fontstyle orstyle

{'normal', 'italic', 'oblique'}

fontvariant orvariant

{'normal', 'small-caps'}

fontweight orweight

{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}

gid

str

horizontalalignment orha

{'left', 'center', 'right'}

in_layout

bool

label

object

linespacing

float (multiple of font size)

math_fontfamily

str

mouseover

bool

multialignment orma

{'left', 'right', 'center'}

parse_math

bool

path_effects

list ofAbstractPathEffect

picker

None or bool or float or callable

position

(float, float)

rasterized

bool

rotation

float or {'vertical', 'horizontal'}

rotation_mode

{None, 'default', 'anchor', 'xtick', 'ytick'}

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

text

object

transform

Transform

transform_rotates_text

bool

url

str

usetex

bool, default:rcParams["text.usetex"] (default:False)

verticalalignment orva

{'baseline', 'bottom', 'center', 'center_baseline', 'top'}

visible

bool

wrap

bool

x

float

y

float

zorder

float

Notes

Note

This is thepyplot wrapper forFigure.text.

On this page