[ncl-talk] color of labels for legend

Adam Phillips asphilli at ucar.edu
Tue Feb 12 17:00:04 MST 2019


Hi Laura,
I think you want to use lgLabelFontColor. There's only one NCL example
script that uses it, which you can find here:
http://www.ncl.ucar.edu/Applications/Scripts/taylor_diagram_cam_uvic.ncl

Note: There's an easier way to create legends that gives the user complete
control over the legend items, sizing, and placement. Take a look at the
simple_legend function:
https://www.ncl.ucar.edu/Document/Functions/Shea_util/simple_legend.shtml
Adam

On Tue, Feb 12, 2019 at 4:22 PM Laura Fowler <laura at ucar.edu> wrote:

> Hello:
>
> I have been fussing trying to get the labels of my legend be the same
> colors as in plot (see legend in the "a. panel" of the attached figure, i.e
> read and blue instead of black. I am sure that it should be rather
> straightforward but I cannot figure it out.
>
> Here are the lines I used to create my legend.
>
> resL at pmLegendDisplayMode    = "Always"                 ; turn on legend
>
> resL at pmLegendSide           = "Bottom"                 ; Change location
> of
>
> resL at pmLegendParallelPosF   = .85                      ; move units right
>
> resL at pmLegendOrthogonalPosF = -0.7                     ; move units down
>
> resL at pmLegendWidthF         = 0.10                     ; Change width and
>
> resL at pmLegendHeightF        = 0.08                     ; height of legend.
>
> resL at lgPerimOn              = False                    ; turn off box
> around
>
> resL at lgLabelFontHeightF     = .016                     ; label font height
>
> resL at lgLabelFont            = 5                        ; label font
>
> resL at xyMonoLineLabelFontColor = False
>
> resL at xyLineLabelFontColors    = (/"red","blue"/)
>
> resL at xyExplicitLegendLabels = (/" s"," (1-s)~S~2~N~"/) ; create explicit
> labels
>
>
> I get the error messages that xyMonoLineLabelFontColor and
> LineLabelFontColors are not available resources. Can you help, please.
>
> Many thanks,
> Laura
>
> --
>
> !-------------------------------------------------------------------------------------------------------------
> Laura D. Fowler
>
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
>
> !-------------------------------------------------------------------------------------------------------------
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190212/208b6615/attachment.html>


More information about the ncl-talk mailing list