[ncl-talk] create fewer explicit legend labels in xy-plot

Tabish Ansari tabishumaransari at gmail.com
Wed Jun 20 17:23:36 MDT 2018


Hi Rashed,

Thanks for your reply.

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.
In my case I just want 3 legends.

Let me know if there's a way to do that.

Cheers,

Tabish

Tabish U Ansari
PhD student, Lancaster Environment Center
Lancaster Univeristy
Bailrigg, Lancaster,
LA1 4YW, United Kingdom

On 20 June 2018 at 23:38, Rashed Mahmood <rashidcomsis at gmail.com> wrote:

> Easiest "tric" would be to set:
> res at xyExplicitLegendLabels = (/"obs","baseline","pulse","","","","","","","","",""/)
>
>
> Does this work? There are several other ways to get this done, let me know
> if this does not work.
>
>
>
> On Wed, Jun 20, 2018 at 1:26 PM, Tabish Ansari <tabishumaransari at gmail.com
> > wrote:
>
>> Hi
>>
>> I have a time-series with 12 different datasets plotted together in a
>> single xy plot.
>>
>> The color looks something like:
>> res at xyLineColors      = (/"black","blue","red","red","
>> red","red","red","red","red","red","red","red" /)
>>
>> And the labeling is currently:
>> res at xyExplicitLegendLabels = (/"obs","baseline","pulse18","
>> pulse19","pulse20","pulse21","pulse22","pulse23","pulse24","pulse25","pulse26","pulse27"/)
>>
>>
>> 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".
>> If I do something like: res at xyExplicitLegendLabels =
>> (/"obs","baseline","pulse"/) , NCL still uses default legend names for all
>> the remaining data.
>> 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?
>>
>> Thanks
>>
>> Tabish
>>
>>
>> Tabish U Ansari
>> PhD student, Lancaster Environment Center
>> Lancaster Univeristy
>> Bailrigg, Lancaster,
>> LA1 4YW, United Kingdom
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180621/734afcf5/attachment.html>


More information about the ncl-talk mailing list