matlab 子图title的位置_matlab(figure和subplot)title text figure标题的使用技巧

1、修改figure标题

h=figure(1);

set(h,'name','your text','Numbertitle','off');

2、text用法

text(10,10,'your text');% 前面两个位置坐标

如果要在text中输入变量,那么

text(10,10,sprintf('这是第%d幅图像(变量i);\n程序运行时间(变量time):%2.2f秒;\n占用百分比:%d%%(变量p);',i,time,p*100));

3、figure区别于子图(subplot)之外的title

第①种方法 :

fig = figure;

a(1) = subplot(2,2,1);

p(1) = plot(rand(10,1));title('1');

a(2) = subplot(2,2,2);

p(2) = plot(rand(10,1));title('2');

a(3) = subplot(2,2,3);

p(3) = plot(rand(10,1));title('3');

a(4) = subplot(2,2,4);

p(4) = plot(rand(10,1));title('4');

ax = axes('position',[0,0,1,1],'visible','off');

tx = text(0.4,0.95,'第一种方法');

set(tx,'fontweight','bold');

第②种方法:

subplot(122);% 在子图后面添加以下内容

ax = axes('position',[0,0,1,1],'visible','off');

tx = text(0.18,0.05,'第二种方法');

set(tx,'fontweight','bold');

第③种方法:

figure;uicontrol('Style','text','String', '第三种方法','Units','normalized','Position', [0.5 0.2 0.1 0.1]);% 修改text句柄

或者

subplot(122);% 在子图后面添加以下内容

ah=gca;axes('position',[0,0,1,1],'visible','off');text(.5,.25,'第三种方法'');axes(ah);

3、gtext用法不多叙述,很简单

figure;gtext('你的文本');% 可以自己选择将文本放在何处

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值