概述
作者按:Matlab中的 figure() 函数主要用于建立图形窗口
用法一 默认参数
>>figure; %默认参数

用法二 和其他图窗函数配合使用,用于建立新窗口显示图形
>>figure,imhist(s); %配合使用于多窗口显示
%若不加figure, imhist()显示的图像会在figure1图窗中显示(覆盖imshow()的图像)

用法三 图形窗口属性及其参数(propertyname & propertyvalue)
>>figure('name','demo'); %图窗命名

>>figure('numbertitle','off'); %关闭图窗标题

>>figure('position', [left, bottom, width, height]); %设定图窗位置(默认以屏幕的左下角为原点)和大小

>>figure('menubar','none','toolbar','none'); %关闭菜单栏(munubar)和工具栏(toolbar)

%多属性合并使用
>>figure('menubar','none','toolbar','none','numbertitle','off','position',[300,200,800,500]);

用法四 数字参数(数字是图形窗口的句柄标记)
>>figure(1); %图形窗口 1
figure(2); %图形窗口 2
%数字必须从1~2147483646的标量整数(参考matlab手册)

用法五 用于多图显示函数 subplot()之前,并结合 set()函数设定figure()的各项属性
>>wd = figure(1);
set(wd, 'name','总图标题', 'numbertitle', 'off');
subplot(231), imshow(p),title('多图显示1');

个人经验,有不当指出还请评论指正。
更多用法参阅:https://ww2.mathworks.cn/help/matlab/ref/figure.html?searchHighlight=figure&s_tid=doc_srchtitle
最后
以上就是仁爱水池为你收集整理的MATLAB中 figure() 函数的用法详解-图文的全部内容,希望文章能够帮你解决MATLAB中 figure() 函数的用法详解-图文所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复