Problem with legends
3 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Daniel Shub
on 11 May 2012
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 Comments
More Answers (1)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!