Draw Legend in MATLAB

3 views (last 30 days)
S. David
S. David on 28 Jul 2014
Answered: Sara on 28 Jul 2014
Hello all,
I have in one figure 5 cases, and in each case I have 3 curves. I distinguish the curves of a single case by no line, solid line, and dotted line. While distinguishing between the different cases by different marks.
If I put all these details in the "legend" it will be too big inside the figure. Instead, I want to put in the legend the 3 cases that distinguish the curves of each case but without the mark, and then I can specify the curves by text arrow.
How can I draw a legend for curves do not appear in the figure?
Thanks

Answers (1)

Sara
Sara on 28 Jul 2014
For the plot you DO NOT want to show in the legend, do:
h = plot(x,y,'-+); %your data
set(get(get(h,'Annotation'),'LegendInformation'),'IconDisplayStyle','off');

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!