[ncl-talk] Histogram Legend without lgLineLabelStrings

Adam Phillips asphilli at ucar.edu
Mon Oct 12 08:02:49 MDT 2020


Hi LSL,
I wonder if the legend text is being drawn but is off of the plot. Try
shifting the position of the legend by setting pmLegendParallelPosF = 0.1.
(You might have to try different settings.) See example 1 here:
http://www.ncl.ucar.edu/Applications/legend.shtml#ex1

Note that legends are not the easiest to draw in NCL using the lg*
resources. If you continue to have difficulty you might want to try the
simple_legend
<http://www.ncl.ucar.edu/Document/Functions/Shea_util/simple_legend.shtml>
function. See example 16 here:
http://www.ncl.ucar.edu/Applications/legend.shtml#ex16

Hope that helps!
Adam

On Sun, Oct 11, 2020 at 2:40 AM LSL <lslrsgis at whu.edu.cn> wrote:

> Thanks for the help from Dennis and Adam. Now there is no complain on the
> screen after executing the ncl script, but there is still no
> lgLineLabelStrings beside the line  on the figure.
>
> LSL
>
> On 2020/10/9 上午9:46, Dennis Shea wrote:
>
>
> Adam: It looks like lgLabelJust needs to be set to (in your case)
> "CenterRight".
>
> You have "CentralRight"
>
> "CentralRight"  ==> "CenterRight"
>
>
>
> On Thu, Oct 8, 2020 at 7:18 PM LSL via ncl-talk <ncl-talk at mailman.ucar.edu>
> wrote:
>
>> Thanks Adam. But it still does not work:
>>
>> fatal:NhlCvtStringToEnum: Unable to convert string "CentralRight" to
>> requested type
>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>> fatal:NhlCvtStringToEnum: Unable to convert string "CentralRight" to
>> requested type
>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>> fatal:NhlCvtStringToEnum: Unable to convert string "CentralRight" to
>> requested type
>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>
>> It seems like something relative to type conversion.
>>
>> LSL
>>
>> On 2020/10/8 上午12:22, Adam Phillips wrote:
>>
>> Hi LSL,
>> Looking at the documentation:
>> http://www.ncl.ucar.edu/Document/Graphics/Resources/lg.shtml#lgLabelJust
>> It looks like lgLabelJust needs to be set to (in your case) "CenterRight".
>> Adam
>>
>> On Wed, Oct 7, 2020 at 6:02 AM LSL via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Thanks for the indication. However, after change from "Right" to
>>> "right", there is still no legend name with prompt information:
>>>
>>> fatal:NhlCvtStringToEnum: Unable to convert string "right" to requested
>>> type
>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>> fatal:NhlCvtStringToEnum: Unable to convert string "right" to requested
>>> type
>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>> fatal:NhlCvtStringToEnum: Unable to convert string "right" to requested
>>> type
>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>>
>>> LSL
>>>
>>> On 2020/10/5 下午10:57, Rick Brownrigg wrote:
>>>
>>> Hi,
>>>
>>> I believe the strings are case-sensitive; it would be "right" rather
>>> than "Right".
>>>
>>> Rick
>>>
>>> On Mon, Oct 5, 2020 at 7:58 AM LSL via ncl-talk <
>>> ncl-talk at mailman.ucar.edu> wrote:
>>>
>>>> Dear NCL community,
>>>>
>>>> I have met a problem when plotting density probability. The histogram
>>>> legend is shown without correct lgLineLabelStrings.
>>>>
>>>> Warnings prompted up at the end of the screen after executing the
>>>> script
>>>> as follows.
>>>>
>>>> fatal:NhlCvtStringToEnum: Unable to convert string "Right" to requested
>>>> type
>>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>>> fatal:NhlCvtStringToEnum: Unable to convert string "Right" to requested
>>>> type
>>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>>> fatal:NhlCvtStringToEnum: Unable to convert string "Right" to requested
>>>> type
>>>> warning:Error retrieving resource lgLabelJust from args - Ignoring Arg
>>>>
>>>>
>>>> The figure and NCL script were attached. Thanks in advance.
>>>>
>>>> LSL
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at mailman.ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://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
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at mailman.ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> https://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: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201012/c7e14af4/attachment.html>


More information about the ncl-talk mailing list