matlab画折线图

2022-07-01 12:46:16 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

p=‘plot_scale.xlsx’; a=xlsread§; x=a(1,:);%x轴上的数据,第一个值代表数据开始,第二个值代表间隔,第三个值代表终止 susan=a(2,:);%a数据y值 HarrisLaplace=a(3,:); MSCP=a(4,:); CPDA=a(5,:); HeYung=a(6,:); FastCPDA=a(7,:); DOG=a(8,:); GCM=a(9,:); ANDD=a(10,:); MSRJ=a(11,:); ZhangSun=a(12,:); WEAE=a(13,:); New_Curvature=a(14,:); ASJ=a(15,:); Superpoint=a(16,:); SOGGDD=a(17,:); % figure(1);

subplot(2,2,1); % plot(x,susan,x,HarrisLaplace,x,MSCP,x,CPDA,x,HeYung,x,FastCPDA,x,DOG,x,GCM,x,ANDD,x,MSRJ,‘linewidth’,3); %线性,颜色,标记 susanp=plot(x,susan,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 1]); hold on; HarrisLaplacep=plot(x,HarrisLaplace,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 0]); hold on; MSCPp=plot(x,MSCP,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 0]); hold on; CPDAp=plot(x,CPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 1 0]); hold on; HeYungp=plot(x,HeYung,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 1]); hold on; FastCPDAp=plot(x,FastCPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 1]); hold on; plot(x,DOG,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.67 0 1]); hold on; GCMp=plot(x,GCM,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0.5 0]); hold on; ANDDp=plot(x,ANDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0.5 0.5]); hold on; MSRJp=plot(x,MSRJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.5 0]); hold on; ZhangSunp=plot(x,ZhangSun,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0 0]); hold on; WEAEp=plot(x,WEAE,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 0]); hold on; New_Curvaturep=plot(x,WEAE,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.9 0.6 0.4]); hold on; ASJp=plot(x,ASJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.73 0.56 0.56]); hold on; Superpointp=plot(x,Superpoint,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.3 0.2 0.5]); hold on; SOGGDDp=plot(x,SOGGDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.647 0]); % grid on;

set(gca,‘GridLineStyle’,’:’,‘GridColor’,‘k’,‘fontsize’,11);

set(gca,‘XTick’,[0.5:0.4:2],‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴范围,间隔 set(gca,‘YTick’,[0.05:0.13:0.7],‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴范围,间隔 ylim([0.05,0.7]); xlim([0.5,2]);

xlabel({‘Uniform scale factor’,’(a) Scale change’},‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴坐标描述

ylabel(‘F-Score’,‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴坐标描述

%%%%%%%%%%%%%%%%%%%%%%%%%%%%rotate%%%%%%%%%%%%%%%%%%%%%%%%%%% pr=‘plot_rotate.xlsx’; ar=xlsread(pr); xr=ar(1,:)*(pi/180);%x轴上的数据,第一个值代表数据开始,第二个值代表间隔,第三个值代表终止 susan=ar(2,:);%a数据y值 HarrisLaplace=ar(3,:); MSCP=ar(4,:); CPDA=ar(5,:); HeYung=ar(6,:); FastCPDA=ar(7,:); DOG=ar(8,:); GCM=ar(9,:); ANDD=ar(10,:); MSRJ=ar(11,:); ZhangSun=ar(12,:); WEAE=ar(13,:); New_Curvature=ar(14,:); ASJ=ar(15,:); Superpoint=ar(16,:); SOGGDD=ar(17,:); % figure(2); subplot(2,2,2); % plot(xr,susan,xr,HarrisLaplace,xr,MSCP,xr,CPDA,xr,HeYung,xr,FastCPDA,xr,DOG,xr,GCM,xr,ANDD,‘linewidth’,3); %线性,颜色,标记 susanp=plot(xr,susan,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 1]); hold on; HarrisLaplacep=plot(xr,HarrisLaplace,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 0]); grid on; MSCPp=plot(xr,MSCP,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 0]); hold on; CPDAp=plot(xr,CPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 1 0]); grid on; HeYungp=plot(xr,HeYung,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 1]); hold on; FastCPDAp=plot(xr,FastCPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 1]); grid on; DOGp=plot(xr,DOG,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.67 0 1]); hold on; GCMp=plot(xr,GCM,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0.5 0]); grid on; ANDDp=plot(xr,ANDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0.5 0.5]); hold on; MSRJp=plot(xr,MSRJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.5 0]); hold on; ZhangSunp=plot(xr,ZhangSun,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0 0]); hold on; WEAEp=plot(xr,WEAE,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 0]); hold on; New_Curvaturep=plot(xr,New_Curvature,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.9 0.6 0.4]); hold on; ASJp=plot(xr,ASJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.73 0.56 0.56]); hold on; Superpointp=plot(xr,Superpoint,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.3 0.2 0.5]); hold on; SOGGDDp=plot(xr,SOGGDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.647 0]); grid on;

set(gca,‘GridLineStyle’,’:’,‘GridColor’,‘k’,‘fontsize’,14);

set(gca,‘XTick’,([-pi/2,-pi/3,-pi/6,0,pi/6,pi/3,pi/2]),‘XTicklabels’,({’-pi/2’,’-pi/3’,’-pi/6’,‘0’,’pi/6’,’pi/3’,’pi/2’}),‘fontname’,‘Times New Roman’,‘fontsize’,11) set(gca,‘YTick’,[0:0.15:0.75],‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴范围,间隔 ylim([0,0.75]) xlim([-pi/2,pi/2]) xlabel({‘Rotation angle’,’(b) Angle change’},‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴坐标描述 ylabel(‘F-Score’,‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴坐标描述

%%%%%%%%%%%%%%%%%%%%%%%%%%%%jpeg%%%%%%%%%%%%%%%%%%%%%%%%%%% pj=‘plot_jpeg.xlsx’; aj=xlsread(pj); xj=aj(1,:);%x轴上的数据,第一个值代表数据开始,第二个值代表间隔,第三个值代表终止 susan=aj(2,:);%a数据y值 HarrisLaplace=aj(3,:); MSCP=aj(4,:); CPDA=aj(5,:); HeYung=aj(6,:); FastCPDA=aj(7,:); DOG=aj(8,:); GCM=aj(9,:); ANDD=aj(10,:); MSRJ=aj(11,:); ZhangSun=aj(12,:); WEAE=aj(13,:); New_Curvature=aj(14,:); ASJ=aj(15,:); Superpoint=aj(16,:); SOGGDD=aj(17,:); % figure(3); subplot(2,2,3);

% plot(xj,susan,xj,HarrisLaplace,xj,MSCP,xj,CPDA,xj,HeYung,xj,FastCPDA,xj,DOG,xj,GCM,xj,ANDD,xj,MSRJ,‘linewidth’,3); %线性,颜色,标记 susanp=plot(xj,susan,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 1]); hold on; HarrisLaplacep=plot(xj,HarrisLaplace,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 0]); grid on; MSCPp=plot(xj,MSCP,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 0]); hold on; CPDAp=plot(xj,CPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 1 0]); grid on; HeYungp=plot(xj,HeYung,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 1]); hold on; FastCPDAp=plot(xj,FastCPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 1]); grid on; DOGp=plot(xj,DOG,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.67 0 1]); hold on; GCMp=plot(xj,GCM,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0.5 0]); grid on; ANDDp=plot(xj,ANDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0.5 0.5]); hold on; MSRJp=plot(xj,MSRJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.5 0]); hold on; ZhangSunp=plot(xj,ZhangSun,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0 0]); hold on; WEAEp=plot(xj,WEAE,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 0]); hold on; New_Curvaturep=plot(xj,New_Curvature,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.9 0.6 0.4]); hold on; ASJp=plot(xj,ASJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.73 0.56 0.56]); hold on; Superpointp=plot(xj,Superpoint,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.3 0.2 0.5]); hold on; SOGGDDp=plot(xj,SOGGDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.647 0]);

grid on; set(gca,‘GridLineStyle’,’:’,‘GridColor’,‘k’);

set(gca,‘XTick’,[5:10:100],‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴范围,间隔 set(gca,‘YTick’,[0:0.15:0.75],‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴范围,间隔 ylim([0,0.75]) xlim([5,100]) % legend(‘SUSAN’,‘Harris-Laplace’,‘MSCP’,‘CPDA’,‘Fast-CPDA’,‘DOG’,‘GCM’,‘ANDD’,‘MSRJ’,‘Location’,‘North’); %右上角标注 xlabel({‘JPEG quality factor’,’© Jpeg compression ‘},‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴坐标描述 ylabel(‘F-Score’,‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴坐标描述

%%%%%%%%%%%%%%%%%%%%%%%%%%%%noise%%%%%%%%%%%%%%%%%%%%%%%%%%% pn=‘plot_noise.xlsx’; an=xlsread(pn); xn=an(1,:);%x轴上的数据,第一个值代表数据开始,第二个值代表间隔,第三个值代表终止 susan=an(2,:);%a数据y值 HarrisLaplace=an(3,:); MSCP=an(4,:); CPDA=an(5,:); HeYung=an(6,:); FastCPDA=an(7,:); DOG=an(8,:); GCM=an(9,:); ANDD=an(10,:); MSRJ=an(11,:); ZhangSun=an(12,:); WEAE=an(13,:); New_Curvature=an(14,:); ASJ=an(15,:); Superpoint=an(16,:); SOGGDD=an(17,:); % figure(4); subplot(2,2,4);

% plot(xn,susan,xn,HarrisLaplace,xn,MSCP,xn,CPDA,xn,HeYung,xn,FastCPDA,xn,DOG,xn,GCM,xn,ANDD,xn,MSRJ,‘linewidth’,3); %线性,颜色,标记 susanp=plot(xn,susan,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 1]); hold on; HarrisLaplacep=plot(xn,HarrisLaplace,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 0]); grid on; MSCPp=plot(xn,MSCP,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 0]); hold on; CPDAp=plot(xn,CPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 1 0]); grid on; HeYungp=plot(xn,HeYung,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 1 1]); hold on; FastCPDAp=plot(xn,FastCPDA,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0 1]); grid on; DOGp=plot(xn,DOG,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.67 0 1]); hold on; GCMp=plot(xn,GCM,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0.5 0]); grid on; ANDDp=plot(xn,ANDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0.5 0.5]); hold on; MSRJp=plot(xn,MSRJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.5 0]); hold on; ZhangSunp=plot(xn,ZhangSun,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.5 0]); hold on; ZhangSunp=plot(xn,ZhangSun,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.5 0 0]); hold on; WEAEp=plot(xn,WEAE,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0 0 0]); hold on; New_Curvaturep=plot(xn,New_Curvature,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.9 0.6 0.4]); hold on; ASJp=plot(xn,ASJ,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.73 0.56 0.56]); hold on; Superpointp=plot(xn,Superpoint,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.3 0.2 0.5]); hold on; % SOGGDDp=plot(xn,SOGGDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[0.8 0.36 0.36]); SOGGDDp=plot(xn,SOGGDD,’-’,‘MarkerSize’,4,‘linewidth’,1.5,‘Color’,[1 0.647 0]); grid on; set(gca,‘GridLineStyle’,’-’,‘GridColor’,‘k’);

set(gca,‘XTick’,[0.005:0.009:0.05],‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴范围,间隔 set(gca,‘YTick’,[0:0.2:0.8],‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴范围,间隔 ylim([0,0.8]) xlim([0.005,0.05]) % legend(‘SUSAN’,‘Harris-Laplace’,‘MSCP’,‘CPDA’,‘Fast-CPDA’,‘DOG’,‘GCM’,‘ANDD’,‘MSRJ’,‘Location’,‘North’); %右上角标注

xlabel({‘Gaussian noise factor’,’(d) Guassian blur ‘},‘fontname’,‘Times New Roman’,‘fontsize’,11) %x轴坐标描述 ylabel(‘F-Score’,‘fontname’,‘Times New Roman’,‘fontsize’,11) %y轴坐标描述

lgd1=legend([susanp,HarrisLaplacep,MSCPp,CPDAp,HeYungp],{‘SUSAN’,‘HarrisLaplacep’,‘MSCP’,‘CPDA’,‘He&Yung’},‘orientation’,‘horizontal’,‘location’,‘north’); set(lgd1,‘FontName’,‘宋体’,‘FontSize’,11); legend(‘boxoff’) ah=axes(‘position’,get(gca,‘position’),‘visible’,‘off’); lgd2=legend(ah,[FastCPDAp,DOGp,GCMp,ANDDp,MSRJp,ZhangSunp],{‘FastCPDA’,‘DOG’,‘GCM’,‘ANDD’,‘MSRJ’,‘Zhang&Sun’},‘orientation’,‘horizontal’,‘location’,‘north’); set(lgd2,‘FontName’,‘宋体’,‘FontSize’,11); legend(‘boxoff’)

ah2=axes(‘position’,get(gca,‘position’),‘visible’,‘off’); lgd3=legend(ah2,[WEAEp,New_Curvaturep,ASJp,Superpointp,SOGGDDp],{‘WEAE’,‘New_Curvature’,‘ASJ’,‘Superpoint’,‘SOGGDD’},‘orientation’,‘horizontal’,‘location’,‘north’); set(lgd3,‘FontName’,‘宋体’,‘FontSize’,11); legend(‘boxoff’)

newPosition = [0.2 0.985 0.5 0]; newUnits = ‘normalized’; set(lgd1,‘Position’, newPosition,‘Units’, newUnits); newPosition2 = [0.2 0.965 0.5 0]; newUnits = ‘normalized’; set(lgd2,‘Position’, newPosition2,‘Units’, newUnits);

newPosition3 = [0.2 0.945 0.5 0]; newUnits = ‘normalized’; set(lgd3,‘Position’, newPosition3,‘Units’, newUnits); set (gcf,‘Position’,[0,0,800,800], ‘color’,‘w’); % print fold2.eps -depsc2 -r600

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/131396.html原文链接:https://javaforall.cn

0 人点赞