Matlab_GUI学习笔记(六)——常用对象的属性之Text
1. Text
Text
为坐标轴Axes
的子对象。可以通过allchild
函数查看Axes
的子对象。
>> ha = axes;
>> ht = text(1,1,'示例');
>> get(ht)
BackgroundColor: 'none'
BeingDeleted: 'off'
BusyAction: 'queue'
ButtonDownFcn: ''
Children: [0×0 GraphicsPlaceholder]
Clipping: 'off'
Color: [0 0 0]
CreateFcn: ''
DeleteFcn: ''
EdgeColor: 'none'
Editing: 'off'
Extent: [1 0.9755 0.0626 0.0491]
FontAngle: 'normal'
FontName: 'Helvetica'
FontSize: 10
FontSmoothing: 'on'
FontUnits: 'points'
FontWeight: 'normal'
HandleVisibility: 'on'
HitTest: 'on'
HorizontalAlignment: 'left'
Interpreter: 'tex'
Interruptible: 'on'
LineStyle: '-'
LineWidth: 0.5000
Margin: 3
Parent: [1×1 Axes]
PickableParts: 'visible'
Position: [1 1 0]
Rotation: 0
Selected: 'off'
SelectionHighlight: 'on'
String: '示例'
Tag: ''
Type: 'text'
UIContextMenu: [0×0 GraphicsPlaceholder]
Units: 'data'
UserData: []
VerticalAlignment: 'middle'
Visible: 'on'
- Interpreter
解释器tex
,latex
在编辑一些公式的时候经常使用到。ha = axes; ht = text(1,1,'示例'); text('String', '\int_0^x dF(x)','Position', [0.5,0.5]); text('interpreter', 'latex', 'String', '$$ \int_0^x dF(x) $$', 'Position', [0.5,0.7]);