itemhitfcn
:def。[](0x0)
¶
当单击图例项时执行的回调函数。详见回调部分 .
回调函数必须具有以下原型fcn (hlegend, evnt)
这里的hlegend
是图例对象句柄,并且evnt
是一个具有以下字段的结构体:
Peer
与单击的项目关联的打印对象的句柄。
Region
可能是"icon"
或"label"
这取决于项目的哪个部分被点击。
SelectionType
什么之中的一个"normal"
, "extend"
, "open"
或"alt"
详见图形"selectiontype"
.
Source
图例对象的句柄。
EventName
名称为"ItemHit"
.
autoupdate
: "off"
| {"on"
}¶
控制将对象添加到对等轴(或从对等轴删除对象)时是否自动更新图例项的数量。例如
## Create a single plot with its legend. figure (); plot (1:10); legend ("Slope 1"); ## Add another plot and specify its displayname so that ## the legend is correctly updated. hold on; plot ((1:10) * 2, "displayname", "Slope 2"); ## Stop automatic updates for further plots. legend ("autoupdate", "off"); plot ((1:10) * 3);
numcolumns
:标量整数,def。1
¶
控制图例项布局中使用的列数。例如
图(); plot (rand (30)); legend ("numcolumns", 3);
背景numcolumns
也迫使numcolumnsmode
属性设置为"manual"
.
orientation
: "horizontal"
| {"vertical"
}¶
控制图例项是垂直排列(按列排列)还是水平排列(按行排列)。
box
: "off"
| {"on"
}¶
控制图例是否有环绕框。
color
:颜色规格,定义。[1 1 1]
¶
图例背景的颜色。详见颜色规格.
edgecolor
:颜色规格,定义。[0.1500 0.1500 0.1500]
¶
控制图例轮廓的颜色。
title
:图形句柄¶
标题文本对象的图形句柄。
location
: "best"
| "bestoutside"
| "east"
| "eastoutside"
| "none"
| "north"
| {"northeast"
} | "northeastoutside"
| "northoutside"
| "northwest"
| "northwestoutside"
| "south"
| "southeast"
| "southeastoutside"
| "southoutside"
| "southwest"
| "southwestoutside"
| "west"
| "westoutside"
¶
控制图例的位置。
position
:四元向量¶
指定图例的位置(不包括其标题)。向量的四个元素是左下角的坐标以及图例的宽度和高度。更改此属性还会切换"location"
到"none"
.
units
: "centimeters"
| "characters"
| "inches"
| {"normalized"
} | "pixels"
| "points"
¶
用于解释的单位"position"
属性
fontangle
: "italic"
| {"normal"
}¶
控制字体是斜体还是普通字体。
fontname
:字符串,def。"*"
¶
用于文本呈现的字体的名称。设置此属性时,文本呈现引擎将在系统中搜索匹配的字体。如果没有找到,则使用默认的无衬线字体(与默认字体相同"*"
价值
编程注意事项:在本机不使用FontConfig的系统上(除了Linux以外的所有系统),字体缓存是在安装Octave时构建的。你需要跑步system ("fc-cache -fv")
安装新字体后手动操作。
fontsize
:标量,def。9
¶
用于文本呈现的字体大小。详见fontunits属性背景fontsize
也迫使fontsizemode
属性设置为"manual"
.
fontunits
: "centimeters"
| "inches"
| "normalized"
| "pixels"
| {"points"
}¶
用于解释的单位"fontsize"
属性
fontweight
: "bold"
| {"normal"
}¶
控制用于文本呈现的基本字体的变体。
string
:string |字符串的元胞数组¶
图例项的标签列表。例如
图(); plot (rand (20)); ## Let legend choose names automatically hl = legend (); ## Selectively change some names str = get (hl, "string"); str(1:5:end) = "Garbage"; set (hl, "string", str);
textcolor
:颜色规格,定义。[0 0 0]
¶
控制图例项的文本字符串的颜色。
版权所有 © 2024-2025 Octave中文网
ICP备案/许可证号:黑ICP备2024030411号-2