How can I add legend to graph with each loop for ezplot?
5 次查看(过去 30 天)
显示 更早的评论
Hello,
I am plotting blending function of bezier curve, in which number of blending curve depends on the number of control points taken.
Now, my problem is I want to add legend for each graph(ezplot) which is plotted by running loop?
Please! help me.
Code is:
%%Plotting of blending curve
for i=1:length(b)
ezplot(b(i),[min(u),max(u)])
hold on
end
0 个评论
回答(1 个)
Walter Roberson
2016-9-16
%%Plotting of blending curve
for i=1:length(b)
h(i) = ezplot(b(i),[min(u),max(u)]);
leg_entries{i} = sprintf('b = %g', b(i));
hold on
end
legend(h, leg_entries)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!