【Matlab】设置绘图窗口大小及颜色

利用set函数设置figure窗口的大小和颜色

为了给定绘图窗口的颜色,使得绘图时窗口大小和位置不乱窜,可以使用set加图像窗口的句柄来设置其属性;

gg1 = figure(1);
set(gg1, 'Position', [100,100,1200,500], 'Color', 'white')
%%(对应图像窗口的句柄,也可用gcf;   位置:xmin ymin xmax ymax; 颜色)

x = 1:0.5:30;
subplot(1,2,1); plot(x,sin(x));  title('First subplot');
subplot(1,2,2);  plot(x,cos(x));  title('Second subplot');

在这里插入图片描述

ref : 1 2


在这里插入图片描述

pic from pexel.com


版权声明:本文为u014636245原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。