Matplotlib is hiring a Research Software Engineering Fellow! See discourse for details. Apply by January 3, 2020
matplotlib.text¶用于在图形中包含文本的类。
matplotlib.text.Annotation(s, xy, xytext=None, xycoords='data', textcoords=None, arrowprops=None, annotation_clip=None, **kwargs)[源代码]¶基类:matplotlib.text.Text, matplotlib.text._AnnotationBase
安 Annotation 是一个 Text 指的是一个特定的位置 xy . (可选)从文本指向 xy 可以画出来。
| 属性: |
|
|---|
注释该点 xy 带文字 s .
在最简单的形式中,文本放置在 xy .
或者,文本可以显示在其他位置 木文 . 从文本指向注释点的箭头 xy 然后可以通过定义 箭头 .
| 参数: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 返回: |
|
参见
anncoords¶要用于的坐标系 Annotation.xyann .
arrow¶3.0 版后已移除: Matplotlib 3.0中已弃用arrow,将在3.2中删除。用箭头补片代替。
draw(renderer)[源代码]¶画出 Annotation 对给定对象的对象 渲染器 .
get_anncoords()¶返回要用于的坐标系 Annotation.xyann .
也见 木栓 在里面 Annotation .
get_window_extent(renderer=None)[源代码]¶返回 Bbox 以显示单位绑定文本和箭头。
| 参数: |
|
|---|
set_anncoords(coords)¶设置要用于的坐标系 Annotation.xyann .
也见 木栓 在里面 Annotation .
xyann¶文本位置。
也见 木文 在里面 Annotation .
matplotlib.text.OffsetFrom(artist, ref_coord, unit='points')[源代码]¶基类:object
用于处理的可调用帮助程序类 Annotation
| 参数: |
|
|---|
matplotlib.text.Text(x=0, y=0, text='', color=None, verticalalignment='baseline', horizontalalignment='left', multialignment=None, fontproperties=None, rotation=None, linespacing=None, rotation_mode=None, usetex=None, wrap=False, **kwargs)[源代码]¶在窗口或数据坐标中处理文本的存储和绘制。
创建一个 Text 实例在 x , y 带弦 text .
有效Kwargs是
财产 描述 agg_filter一种过滤函数,它接受一个(m,n,3)浮点数组和一个dpi值,并返回一个(m,n,3)数组。 alpha浮动 animated布尔 backgroundcolor颜色 bbox带有属性的dict patches.FancyBboxPatchclip_boxmatplotlib.transforms.Bboxclip_on布尔 clip_path{ ( path.Path,transforms.Transform),patches.Patch, None }color颜色 contains可赎回的 figureFigurefontfamilyfontname,'serif'、'sans-serif'、'cursive'、'fantasy'、'monospace' fontnamefontname,'serif'、'sans-serif'、'cursive'、'fantasy'、'monospace' fontpropertiesfont_manager.FontPropertiesfontsize以点为单位的大小,'x x small'、'x-small'、'small'、'medium'、'large'、'x-large'、'x x large' fontstretch范围0-1000内的数值,'ultra condensed'、'extra condensed'、'condensed'、'semi condensed'、'normal'、'semi expanded'、'expanded'、'extra expanded'、'extra expanded'、'extra expanded'、'extra exp fontstyle'正常'、'斜体'、'斜体' fontvariant“普通”、“小大写” fontweight范围为0-1000、'ultralight'、'light'、'normal'、'regular'、'book'、'medium'、'roman'、'semibold'、'demi bold'、'demi'、'bold'、'heavy'、'extra bold'、'black'的数值。 gidSTR horizontalalignment“居中”、“右”、“左” in_layout布尔 label对象 linespacing浮动(字体大小的倍数) multialignment'左'、'右'、'中' path_effectsAbstractPathEffectpicker无或bool或float或callable position(浮标,浮标) rasterized布尔或无 rotation角度(度)、“垂直”、“水平” rotation_mode无,'默认值','定位点' sketch_params(比例:浮动,长度:浮动,随机性:浮动) snap布尔或无 text可转换为字符串的字符串或对象(但 None变成'')transformTransformurlSTR usetex布尔或无 verticalalignment‘中心’、‘顶部’、‘底部’、‘基线’、‘中心基线’; visible布尔 wrap布尔 x浮动 y浮动 zorder浮动
get_bbox_patch()[源代码]¶返回bbox补丁,如果 patches.FancyBboxPatch 不是制造出来的。
get_family(*args, **kwargs)¶get_font_properties(*args, **kwargs)¶get_ha(*args, **kwargs)¶get_name(*args, **kwargs)¶别名 get_fontname
get_size(*args, **kwargs)¶别名 get_fontsize
get_style(*args, **kwargs)¶get_usetex()[源代码]¶返回是否 Text 对象使用tex进行渲染。
如果用户没有手动设置此值,则默认为 rcParams["text.usetex"] .