%分两行显示图例,首先需要句柄
h1=plot(x,y1,'r-o');
hold on;
h2=plot(x,y2,'k-d');
hold on;
h3=plot(x,y3,'b-s');
hold on;
h4=plot(x,y4,'m-<');
axis([1 4 0 20]);
lgd1=legend([h1,h2],'第一个图例','第二个图例','orientation','horizontal','location','north');
set(lgd1,'FontName','宋体','FontSize',14);
ah=axes('position',get(gca,'position'),'visible','off');
lgd2=legend(ah,[h3,h4],'第三个图例','第四个图例','orientation','horizontal','location','north');
set(lgd2,'FontName','宋体','FontSize',14);
————————————————
版权声明:本文为CSDN博主「Phr-2105」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_41492768/article/details/90699836