matlab(figure和subplot)title text figure标题的使用技巧
2016-05-03 16:38
731 查看
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('你的文本');% 可以自己选择将文本放在何处
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('你的文本');% 可以自己选择将文本放在何处
相关文章推荐
- 把网站链接卖一个好价钱: Text Link Ads 注册网赚攻略
- MSSQL数据库获取TEXT字段的内容长度
- 为了防止乱码,请将用于页面编码的meta charset放到title的前面
- HTML实现title 属性换行小技巧
- 『jQuery』.html(),.text()和.val()的概述及使用
- 用jquery模仿的a的title属性的例子
- 解析在main函数之前调用函数以及对设计的作用详解
- JavaScript开发者必备的10个Sublime Text插件
- Jquery修改页面标题title其它JS失效的解决方法
- 点击button获取text内容并改变样式的js实现
- JQuery中Text方法用法实例分析
- jQuery获取Select选择的Text和Value(详细汇总)
- jQuery操作Select选择的Text和Value(获取/设置/添加/删除)
- JavaScript修改浏览器tab标题小技巧
- 详解Matlab中 sort 函数用法
- firefox下获取下列框选中option的text的代码
- JS获取下拉列表所选中的TEXT和Value的实现代码
- js获取TreeView控件选中节点的Text和Value值的方法
- mssql查找备注(text,ntext)类型字段为空的方法
- 对text数据类型不支持代码页转换 从: 1252 到: 936