请教 legend函数
楼主 · 1 楼
如何动态追加legend函数?
我现在两个程序中得出了两幅图,要将其放置在一起进行比较,现在不知如何使用legend函数分别对函数进行说明。
谢谢!!!
我现在两个程序中得出了两幅图,要将其放置在一起进行比较,现在不知如何使用legend函数分别对函数进行说明。
谢谢!!!
2 楼
i have known how to resolve it
you can use the following example as a guide.
%creat a plot with a legend
plot(rand(5));
legend('one','two','three','four','five')
hold on
t=0:0.1:2*pi;
hnew=plot(t,sin(t))
[legh,objh,outh,outm]=legend;
%add object with new handle and new legend string to legend
legend([outh;hnew],out{:},'New legend text')
that's ok!
you can use the following example as a guide.
%creat a plot with a legend
plot(rand(5));
legend('one','two','three','four','five')
hold on
t=0:0.1:2*pi;
hnew=plot(t,sin(t))
[legh,objh,outh,outm]=legend;
%add object with new handle and new legend string to legend
legend([outh;hnew],out{:},'New legend text')
that's ok!