matlab 标注字体可以设置吗

如题所述

matlab常用的字体注释函数为text()和annotation()

1. text()可以灵活的设定标注文本的多种属性:例如:

位置,内容,大小,颜色,对齐,字体,字号。

请参考以下matlab代码:

% ==================================

t = 0:100;

plot(t,sin(0.5*t)) % 画出任意图形,待标注

h = text(20,0,'Nexus');% 输出文字在坐标(20,0)

set(h,'FontWeight','bold','FontSize',60)% 设置加粗字体,字号60

set(h,'FontName','Arial Rounded MT Bold');% 设置字体

set(h,'FontAngle','italic');% 设置斜字体

set(h, 'Color','r');% 设置字体颜色

% ==================================

2. annotation具有与text()类似的用法。

用法如下:

annotation('textbox',[x y w h])

输出结果为:

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答