matplotlib.pyplot.figtext#
- matplotlib.pyplot.figtext(x, y, s, fontdict=None, **kwargs)[source]#
向图形添加文本。
- 参数:
- x, y浮点数
放置文本的位置。默认情况下,它位于图形坐标中,浮点数在 [0, 1] 范围内。可以通过使用 transform 关键字更改坐标系。
- s字符串
文本字符串。
- fontdict字典,可选
一个字典,用于覆盖默认文本属性。如果未给出,默认值由
rcParams["font.*"]
决定。作为 *kwargs* 传递的属性将覆盖 *fontdict* 中给出的相应属性。
- 返回:
- 其他参数:
- **kwargs
Text
属性 其他杂项文本参数。
属性
描述
一个过滤函数,它接受一个 (m, n, 3) 浮点数组和一个 dpi 值,并返回一个 (m, n, 3) 数组以及图像左下角的两个偏移量
浮点数或 None
布尔值
布尔值
包含
patches.FancyBboxPatch
属性的字典未知
未知
未知
fontfamily
或family
或fontname
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
float 或 {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
{0-1000 范围内的数值, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
{'normal', 'italic', 'oblique'}
{'normal', 'small-caps'}
{0-1000 范围内的数值, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
字符串
{'left', 'center', 'right'}
布尔值
对象
float (字体大小的倍数)
字符串
布尔值
{'left', 'right', 'center'}
布尔值
None 或 布尔值 或 浮点数 或 可调用对象
(浮点数, 浮点数)
布尔值
float 或 {'vertical', 'horizontal'}
{None, 'default', 'anchor'}
(scale: 浮点数, length: 浮点数, randomness: 浮点数)
布尔值或 None
对象
布尔值
字符串
布尔值,默认值:
rcParams["text.usetex"]
(默认值:False
){'baseline', 'bottom', 'center', 'center_baseline', 'top'}
布尔值
布尔值
浮点数
浮点数
浮点数
- **kwargs
另请参阅
备注
注意
这是 pyplot 包装器,用于
Figure.text
。