<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265157</link>
    <title>MATLAB Central Newsreader - Only show a few signals in legend</title>
    <description>Feed for thread: Only show a few signals in legend</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 06 Nov 2009 09:55:05 -0500</pubDate>
      <title>Only show a few signals in legend</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265157#692633</link>
      <author>Henrieke </author>
      <description>Hi everyone!&lt;br&gt;
&lt;br&gt;
I have a plot containing about 20 signals. I would like to display a legend which only contains a limited number of those signals...&lt;br&gt;
&lt;br&gt;
Example: I only want to display a legend for signal A and C&lt;br&gt;
&lt;br&gt;
If I use a code like this:&lt;br&gt;
&lt;br&gt;
legend(['Signal A' 'C' ]) &lt;br&gt;
&lt;br&gt;
the legend will use the line color of Signal B instead of C.&lt;br&gt;
&lt;br&gt;
a code like this&lt;br&gt;
&lt;br&gt;
legend(['Signal A'  ' '  'C' ]) &lt;br&gt;
&lt;br&gt;
&amp;nbsp;will display all the linetypes in the legend witout giving a name for Signal B.&lt;br&gt;
&lt;br&gt;
Anyone has an idea?&lt;br&gt;
Thanks a lot&lt;br&gt;
Henni</description>
    </item>
    <item>
      <pubDate>Fri, 06 Nov 2009 12:19:01 -0500</pubDate>
      <title>Re: Only show a few signals in legend</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265157#692661</link>
      <author>Jos </author>
      <description>&quot;Henrieke &quot; &amp;lt;Henni_Niermann@NOSPAMhotmail.com&amp;gt; wrote in message &amp;lt;hd0rpo$88k$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi everyone!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a plot containing about 20 signals. I would like to display a legend which only contains a limited number of those signals...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Example: I only want to display a legend for signal A and C&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If I use a code like this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; legend(['Signal A' 'C' ]) &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the legend will use the line color of Signal B instead of C.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; a code like this&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; legend(['Signal A'  ' '  'C' ]) &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;  will display all the linetypes in the legend witout giving a name for Signal B.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Anyone has an idea?&lt;br&gt;
&amp;gt; Thanks a lot&lt;br&gt;
&amp;gt; Henni&lt;br&gt;
&lt;br&gt;
Use the plot handles to create the legend. &lt;br&gt;
&lt;br&gt;
H = plot(rand(10,4),'-')  % 4 lines&lt;br&gt;
legend(H([1 3]),{'1st signal','3rd signal'})&lt;br&gt;
&lt;br&gt;
hth&lt;br&gt;
Jos</description>
    </item>
  </channel>
</rss>

