绘制特定大小的图片+利用for循环生成子图

close all;clear all
   set(gcf,'PaperPositionMode', 'manual')%纸张模式改为手动
   set(gcf,'PaperUnits','inches')%设定纸张单位为英寸
   set(gcf,'PaperPosition',[0 0 12 8])%设定纸张大小(16*8英寸)
for i=1:6
    subplot(2,3,i)%子图循环
    x=0:pi/10:2*pi;
    plot(x,x.^i);%绘图循环
    title(['y=x^',num2str(i)])%设置标题
end
print(gcf,'fig03','-dpng','-r0')%打印图窗

图片如下: 

绘制特定大小的图片+利用for循环生成子图_第1张图片

你可能感兴趣的:(图形绘制)