"Henrieke " <Henni_Niermann@NOSPAMhotmail.com> wrote in message <hd0rpo$88k$1@fred.mathworks.com>...
> Hi everyone!
>
> I have a plot containing about 20 signals. I would like to display a legend which only contains a limited number of those signals...
>
> Example: I only want to display a legend for signal A and C
>
> If I use a code like this:
>
> legend(['Signal A' 'C' ])
>
> the legend will use the line color of Signal B instead of C.
>
> a code like this
>
> legend(['Signal A' ' ' 'C' ])
>
> will display all the linetypes in the legend witout giving a name for Signal B.
>
> Anyone has an idea?
> Thanks a lot
> Henni
Use the plot handles to create the legend.
H = plot(rand(10,4),'-') % 4 lines
legend(H([1 3]),{'1st signal','3rd signal'})
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.