Matlab GUI常用对象之text

来源:互联网 发布:怎么把电脑变成数据库 编辑:程序博客网 时间:2024/06/18 08:23

text对象的属性:

ht=text(0.5,0.5,'这是text')

 get(ht)

Annotation = [ (1 by 1) hg.Annotation array]

BackgroundColor = none           字体背景颜色

Color = [0 0 0]                   字体颜色

DisplayName = 

EdgeColor = none                 边缘颜色

Editing = off                     不能对其进行编辑

Extent = [0.496552 0.469388 0.128736 0.0524781]

FontAngle = normal             字体的倾斜角度

FontName = Helvetica           字体名称

FontSize = [10]                 字体大小

FontUnits = points              字体单位

FontWeight = normal            是否是加粗倾斜效果

HorizontalAlignment = left       字体的对齐方式

LineStyle = -

LineWidth = [0.5]

Margin = [2]

Position = [0.5 0.5 0]            位置属性(x,y)坐标

Rotation = [0]                 旋转角度

String = 这是text              要显示的文字

Units = data

Interpreter = tex                     公式编辑

VerticalAlignment = middle            对齐方式

 

BeingDeleted = off

ButtonDownFcn = 

Children = []

Clipping = off

CreateFcn = 

DeleteFcn = 

BusyAction = queue

HandleVisibility = on

HitTest = on

Interruptible = on

Parent = [0.0012207]

Selected = off

SelectionHighlight = on

Tag = 

Type = text

UIContextMenu = []

UserData = []

Visible = on

举例:

% ht=text(0.5,0.5,'这是text');text('String','\int_1^xdF(x)',...%默认为tex公式编辑方式    'position',[0.5 0.5],...%在(0.5,0.5)显示在(1,x)上对F(x)的积分    'fontsize',20); text('interpreter','latex',...%使用latex编辑公式    'string','$$\int_1^xdF(x)\!\int_0^ydF(y)$$',... %公式    'position',[0.2 0.2],...语法    'fontsize',25);

运行结果:(上面为tex编辑的,下面是latex编辑的)



0 0