【Matlab】一个Figure中绘制多组图

有些时候,需要同时绘制多个图像到一个Figure上,利用subplot可以轻松实现下图的效果:
在这里插入图片描述

clear;
%% IBEA
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');

%% KnEA
subplot(2, 3, 2);
x = [0.1000    0.2000    0.3000    0.4000    0.5000    0.6000    0.7000    0.8000    0.9000];
hv = [0.2365    0.0961    0.2732    0.2258    0.1653    0.1452    0.2831    0.1904    0.2276
    0.2002    0.1702    0.2385    0.2051    0.2055    0.2021    0.3683    0.1904    0.2670
    0.0810    0.1576    0.1576    0.3877    0.1885    0.2269    0.2208    0.3539    0.1481
    0.1213    0.1904    0.1765    0.3528    0.1879    0.3100    0.2040    0.2259    0.3541
    0.3890    0.2260    0.1576    0.2848    0.1718    0.1896    0.3033    0.2264    0.1938
    0.1704    0.3547    0.2943    0.2571    0.1397    0.1937    0.2140    0.2626    0.1783
    0.2543    0.2326    0.1407    0.1572    0.2749    0.2658    0.3327    0.3467    0.1576
    0.1572    0.3626    0.2683    0.2068    0.3122    0.2606    0.1400    0.1904    0.2262
    0.2934    0.2672    0.3543    0.3084    0.2412    0.1522    0.2013    0.1586    0.1636
    0.1576    0.2798    0.1576    0.3697    0.2632    0.2437    0.3758    0.3776    0.2523];
boxplot(hv,'labels', x);
xlabel('(2) Rate of knee points in the population', 'fontname', 'Times new roman','interpreter', 'latex');

%% MOEADCMA
subplot(2, 3, 3);
rates = [3     5     7     9    11];
hv = [0.4001    0.4093    0.4121    0.3636    0.3921
    0.3927    0.3952    0.3788    0.3639    0.4111
    0.4103    0.4098    0.3361    0.3828    0.3086
    0.4151    0.4063    0.3325    0.3977    0.2595
    0.3544    0.3806    0.4132    0.4082    0.4023
    0.3996    0.3913    0.3942    0.4156    0.3972
    0.3933    0.3848    0.3268    0.3656    0.4254
    0.3141    0.3975    0.4148    0.3932    0.3331
    0.4024    0.3716    0.3439    0.3920    0.3846
    0.4148    0.3960    0.4061    0.3340    0.3511];
boxplot(hv,'labels', rates);
xlabel('(3) Number of groups', 'fontname', 'Times new roman','interpreter', 'latex');

%% RVEA
subplot(2, 3, 4);
rates = [1     2     3     4     5     6     7     8     9];
hv = [0.2024    0.2269    0.2919    0.2975    0.2429    0.2141    0.3622    0.2210    0.1411
    0.2994    0.2290    0.3710    0.2071    0.2231    0.2912    0.1503    0.2748    0.2518
    0.3710    0.3785    0.0920    0.2389    0.2938    0.2114    0.2202    0.3783    0.3728
    0.2111    0.2353    0.3050    0.2880    0.2770    0.2798    0.2513    0.3741    0.1473
    0.2143    0.2198    0.1861    0.2640    0.3752    0.2766    0.3826    0.2977    0.3174
    0.2967    0.2020    0.2922    0.2553    0.3114    0.2417    0.3363    0.2822    0.2936
    0.2753    0.2181    0.1758    0.3632    0.1762    0.2406    0.3693    0.3769    0.3010
    0.2362    0.2046    0.1051    0.2644    0.2719    0.1998    0.2561    0.1480    0.2187
    0.3738    0.2272    0.3825    0.2820    0.2667    0.1844    0.2599    0.2961    0.2982
    0.2378    0.1618    0.2756    0.2065    0.1880    0.2227    0.1759    0.1999    0.2004];
boxplot(hv,'labels', rates);
xlabel('(4) $$f_r$$ is fixed to 0.1 and $$\alpha$$ changes from 1 to 9',...
'fontname', 'Times new roman','interpreter', 'latex');

%% RVEA2
subplot(2, 3, 5);
rates = [0.0100    0.0500    0.1000    0.3000    0.5000];
hv = [0.2708    0.2815    0.2209    0.1927    0.2717
    0.3853    0.2104    0.2750    0.2588    0.2289
    0.3667    0.3699    0.3785    0.3765    0.2884
    0.1925    0.3819    0.3741    0.2215    0.2559
    0.1930    0.2876    0.2973    0.3755    0.3059
    0.1802    0.3719    0.2815    0.3763    0.3738
    0.1462    0.2665    0.3767    0.2216    0.2946
    0.1858    0.2749    0.1483    0.2796    0.1566
    0.1997    0.2257    0.2953    0.2699    0.1925
    0.1026    0.2973    0.2000    0.2585    0.3014];
boxplot(hv,'labels', rates);
xlabel('(5) $$\alpha$$ is fixed to 8 and $$f_r$$ changes from 0.01 to 0.5', 'fontname', 'Times new roman','interpreter', 'latex');

猜你喜欢

转载自blog.csdn.net/zyxhangiian123456789/article/details/105883707