MATLAB中subplot函数使用

格式:subplot(m,n,p) 或 subplot(m n p)
将多个图显示到一个平面上的函数。其中m,n表示窗口被分为m*n块区域,p表示当前图所在位置。p=1表示从左到右从上到下的第一个位置.

clear;
subplot(2,3,1);%第一块绘图
x=[0.1000,0.0500,0.0100,0.0050];
hv= [0.4742    0.5203    0.4863    0.4808
    0.4033    0.4782    0.3993    0.4846
    0.4820    0.3849    0.4863    0.4852
    0.4350    0.4012    0.4855    0.4828
    0.4742    0.4953    0.4855    0.3814
    0.3854    0.4833    0.4386    0.4644
    0.4771    0.4334    0.3903    0.3980
    0.4750    0.4087    0.4503    0.4892
    0.4276    0.4783    0.4918    0.4874
    0.3789    0.3545    0.4823    0.3987];
boxplot(hv,'labels',x);
xlabel('(1) Fitness scaling factor','fontname','Times new roman','interpreter','latex');
subplot(2,3,2);%第二块绘图
subplot(2,3,4);%第四块绘图
subplot(2,3,5);
subplot(2,3,6);

运行结果如下:
运行结果

猜你喜欢

转载自blog.csdn.net/wsj_jerry521/article/details/110980917