-
matplotlib.pyplot.text()官方文档
matplotlib.pyplot.text(x, y, s, fontdict=None, withdash=False, **kwargs)
通过函数方式,向 a x e s axes axes对象添加 t e x t text text对象,确切的说是向 a x e s axes axes的 ( x , y ) (x,y) (x,y)位置添加 s s s文本。返回一个text实例。
-
x, y : scalars 防止text的位置
-
s : str 内容text
-
fontdict : dictionary, optional, default: None 一个定义s格式的dict
-
withdash : boolean, optional, default: False。如果True则创建一个
TextWithDash实例。以下为其他常用参数1:
-
fontsize设置字体大小,默认12,可选参数 [‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’,‘x-large’, ‘xx-large’] -
fontweight设置字体粗细,可选参数 [‘light’, ‘normal’, ‘medium’, ‘semibold’, ‘bold’, ‘heavy’, ‘black’] -
fontstyle设置字体类型,可选参数[ ‘normal’ | ‘italic’ | ‘oblique’ ],italic斜体,oblique倾斜 -
verticalalignment设置水平对齐方式 ,可选参数 : ‘center’ , ‘top’ , ‘bottom’ ,‘baseline’ -
horizontalalignment设置垂直对齐方式,可选参数:left,right,center -
rotation(旋转角度)可选参数为:vertical,horizontal 也可以为数字 -
alpha透明度,参数值0至1之间 -
backgroundcolor标题背景颜色 -
bbox给标题增加外框 ,常用参数如下:boxstyle方框外形facecolor(简写fc)背景颜色edgecolor(简写ec)边框线条颜色edgewidth边框线条大小
本文是matplotlib.pyplot.text()的官方文档解读。该函数可向axes对象的(x,y)位置添加文本s并返回text实例。文中详细介绍了其参数,如x、y为位置,s为文本内容,还说明了字体大小、粗细、对齐方式等常用参数,以及标题背景颜色、外框等设置。
552

被折叠的 条评论
为什么被折叠?



