Problem with legends
3 次查看(过去 30 天)
显示 更早的评论
Hello I will use this example for explain my question
figure t=0:pi/200:2*pi; tt= t(1:100:length(t)); plot(t,sin(t)),'b') hold on plot(tt,sin(tt),'b*') legend('a','b')
I have a lot of points, in one curve, and to differentiated with other curves I want to put it square circles or *, the problem is the legend; Is it possible to pluck the two legends in one?.
Or exist other form to do this, because I can not decrease the number of data.
0 个评论
采纳的回答
Daniel Shub
2012-5-11
I don't know of an easy clean way to do it, but you can hack it pretty easily by plotting an empty plot with the desired line ...
figure
plot([inf, inf], [inf, inf], 'b-*')
hold on
t=0:pi/200:2*pi;
tt= t(1:100:length(t));
plot(t,sin(t),'b')
hold on
plot(tt,sin(tt),'b*')
legend('ab')
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!