标签:技术分享 效果 legend for 循环 for mat http matlab 分享
x = 1:10;
for i = 1:4
y = i*x;
h = plot(x,y);
hold on
end
legend(h([1,2,3,4]),‘y1‘,‘y2‘,‘y3‘,‘y4‘)
在 for 循环中根据循环改变 legend,效果图如下

标签:技术分享 效果 legend for 循环 for mat http matlab 分享
原文地址:https://www.cnblogs.com/qinghev/p/9974785.html