1. 程式人生 > >matlab 畫圖參考小程序

matlab 畫圖參考小程序

spa 畫圖 3.2 style 0.12 des 表數據 xlabel 第一個

x=0.1:0.1:0.9;  
 a=[41.37,44.34,44.34,44.66,44.66,44.66,98.85,98.85,98.85];%xxxxxx
 b=[22.10,22.39,22.39,29.77,29.77,29.77,86.01,86.01,86.01]; %xxxxxx
 plot(x,a,-or,x,b,-sb,LineWidth,1);    
axis([0.1,0.9,0,100])  
set(gca,XTick,[0.1:0.1:0.9])
set(gca,YTick,[0:10:100])
legend(文獻[54],本文);   
xlabel(
期望值,FontSize,10,FontWeight,bold) ylabel(聚合率(%),FontSize,10,FontWeight,bold) set(gca,linewidth,1)

技術分享圖片

x=100:100:600;%x軸上的數據,第一個值代表數據開始,第二個值代表間隔,第三個值代表終止
 a=[1.496,1.558,1.576,1.598,1.644,1.695]; %a數據y值
 b=[1.63,1.684,1.733,1.764,1.833,1.899]; %b數據y值
 c=[1.779,1.921
,2.002,2.09,2.171,2.232]; %b數據y值 plot(x,a,-*b,x,b,-or,x, c,-+g,linewidth,1); %線性,顏色,標記 axis([100,600,1.45,2.25]) %確定x軸與y軸框圖大小 set(gca,XTick,[100:100:600]) %x軸範圍1-6,間隔1 set(gca,YTick,[1.45:0.125:2.25]) %y軸範圍0-700,間隔100 legend(Two nodes,There nodes,Four nodes); %右上角標註 xlabel(Number of iTrees
) %x軸坐標描述 ylabel(Speedup) set(gca,linewidth,1)

技術分享圖片

 x=100:100:600;%x軸上的數據,第一個值代表數據開始,第二個值代表間隔,第三個值代表終止
 a=[0.505,1.393,2.276,3.135,4.031,5.028]; %a數據y值
 b=[0.695,0.783,0.88,0.997,1.09,1.167]; %b數據y值
 c=[0.58,0.673,0.838,0.887,0.973,0.987]; %b數據y值
 plot(x,a,-*b,x,b,-or,x, c,-+g,linewidth,1); %線性,顏色,標記
axis([100,600,0.5,5.25])  %確定x軸與y軸框圖大小
set(gca,XTick,[100:100:600]) %x軸範圍1-6,間隔1
set(gca,YTick,[0.5:0.75:5.25]) %y軸範圍0-700,間隔100
legend(iforest,iforestMapReduce,iforestSpark);   %右上角標註
xlabel( Number of iTrees )  %x軸坐標描述
ylabel(Operation time(min))
set(gca,linewidth,1)

技術分享圖片

x=100:100:600;%x軸上的數據,第一個值代表數據開始,第二個值代表間隔,第三個值代表終止
 a=[0.733,2.039,3.329,4.565,5.891,7.383]; %a數據y值
 b=[1.58,1.647,1.73,1.813,1.917,1.98]; %b數據y值
 c=[0.647,0.72,0.837,0.91,0.99,1.05]; %b數據y值
 plot(x,a,-*b,x,b,-or,x, c,-+g,linewidth,1); %線性,顏色,標記
axis([100,600,0.5,7.5])  %確定x軸與y軸框圖大小
set(gca,XTick,[100:100:600]) %x軸範圍1-6,間隔1
set(gca,YTick,[0.5:0.75:7.5]) %y軸範圍0-700,間隔100
legend(iforest,iforestMapReduce,iforestSpark);   %右上角標註
xlabel( Number of iTrees )  %x軸坐標描述
ylabel(Operation time(min))
set(gca,linewidth,1)

技術分享圖片

x=100:100:600;%x軸上的數據,第一個值代表數據開始,第二個值代表間隔,第三個值代表終止
 a=[1.007,2.815,4.591,6.31,8.153,10.132]; %a數據y值
 b=[2.543,2.703,2.803,2.933,3.15,3.25]; %b數據y值
 c=[0.733,0.82,0.893,0.947,1.047,1.107]; %b數據y值
 plot(x,a,-*b,x,b,-or,x, c,-+g,linewidth,1); %線性,顏色,標記
axis([100,600,0.5,10.5])  %確定x軸與y軸框圖大小
set(gca,XTick,[100:100:600]) %x軸範圍1-6,間隔1
set(gca,YTick,[0.5:2:10.5]) %y軸範圍0-700,間隔100
legend(iforest,iforestMapReduce,iforestSpark);   %右上角標註
xlabel( Number of iTrees )  %x軸坐標描述
ylabel(Operation time(min))
set(gca,linewidth,1)

技術分享圖片

matlab 畫圖參考小程序