<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hi Tabish,</div><div>Take a look at simple_legend:</div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Shea_util/simple_legend.shtml">https://www.ncl.ucar.edu/Document/Functions/Shea_util/simple_legend.shtml</a></div><div><br></div><div>You can completely control the legend creation this way, and therefore can only draw the legend items that you want.</div><div>Hope that helps!</div><div>Adam</div><div><br>On Jun 20, 2018, at 5:23 PM, Tabish Ansari <<a href="mailto:tabishumaransari@gmail.com">tabishumaransari@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi Rashed,<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Thanks for your reply.<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I tried your suggestion but as we might expect, it still drew the all the legend lines - 3 with labels and rest without any label.<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">In my case I just want 3 legends.<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Let me know if there's a way to do that.<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Cheers,<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Tabish<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><font size="1"><span style="font-family:tahoma,sans-serif">Tabish U Ansari<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">PhD student, Lancaster Environment Center<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">Lancaster Univeristy<br> <span>Bailrigg</span>, <span>Lancaster</span>, <br><span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br></div></div></div>
<br><div class="gmail_quote">On 20 June 2018 at 23:38, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Easiest "tric" would be to set:</div><div>res@xyExplicitLegendLabels = (/"obs","baseline","pulse","",<wbr>"","","","","","","",""/) <br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Does this work? There are several other ways to get this done, let me know if this does not work.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jun 20, 2018 at 1:26 PM, Tabish Ansari <span dir="ltr"><<a href="mailto:tabishumaransari@gmail.com" target="_blank">tabishumaransari@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="font-family:trebuchet ms,sans-serif">Hi<br><br></div><div style="font-family:trebuchet ms,sans-serif">I have a time-series with 12 different datasets plotted together in a single xy plot.<br></div><div style="font-family:trebuchet ms,sans-serif"><br>The color looks something like:<br>res@xyLineColors = (/"black","blue","red","red","<wbr>red","red","red","red","red","<wbr>red","red","red" /)<br><br></div><div style="font-family:trebuchet ms,sans-serif">And the labeling is currently:<br>res@xyExplicitLegendLabels = (/"obs","baseline","pulse18","<wbr>pulse19","pulse20","pulse21","<wbr>pulse22","pulse23","pulse24","<wbr>pulse25","pulse26","pulse27"/) <br><br></div><div style="font-family:trebuchet ms,sans-serif">However, I do not want all the labels. Since all the "pulse" data are red in color, I just want to draw a single red legend with a name "pulse".<br></div><div style="font-family:trebuchet ms,sans-serif">If I do something like: res@xyExplicitLegendLabels = (/"obs","baseline","pulse"/) , NCL still uses default legend names for all the remaining data.<br></div><div style="font-family:trebuchet ms,sans-serif">I do not want that. Is there a way to only draw 3 legends when the data itself has more than 3 arrays within it?<br><br></div><div style="font-family:trebuchet ms,sans-serif">Thanks<br><br></div><div style="font-family:trebuchet ms,sans-serif">Tabish<br></div><div style="font-family:trebuchet ms,sans-serif"><br></div><div style="font-family:trebuchet ms,sans-serif"><br clear="all"></div><div><div class="m_-4140520770489107663m_3311577145073747805gmail_signature"><div dir="ltr"><div><div><font size="1"><span style="font-family:tahoma,sans-serif">Tabish U Ansari<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">PhD student, Lancaster Environment Center<br></span></font></div><font size="1"><span style="font-family:tahoma,sans-serif">Lancaster Univeristy<br> <span>Bailrigg</span>, <span>Lancaster</span>, <br><span>LA1 4YW</span>, <span>United Kingdom</span></span></font><br></div></div></div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>ncl-talk mailing list</span><br><span><a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a></span><br><span>List instructions, subscriber options, unsubscribe:</span><br><span><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></span><br></div></blockquote></body></html>