[ncl-talk] exponential format for label bar

Mary Haley haley at ucar.edu
Wed Mar 22 09:15:18 MDT 2017


Zhifeng,

Thanks for providing the files offline. I see what the problem is, and it's
a bit complex to explain here. It's a bug that's been in our code for
awhile. It was marked to be fixed for NCL V6.5.0, but I have elevated it to
be fixed for V6.4.1.

I do have a fix:

Save the attached files "add_labelbar_630.ncl" and "add_labelbar_640.ncl".

Which one you use depends on whether you have NCL V6.4.0 (use
add_labelbar_640,ncl) or NCL V6.3.0 or earlier (use add_labelbar_630.ncl).

Add the following line to your script, after any other potential "load"
commands:

load "./add_labelbar_xxx.ncl"

Replacing "xxx" with the appropriate 630 or 640.

Try your script again and see if it works.

You only need this fixed if you need to set cnLineLabelFormat.

Let me know if it doesn't work for you.

--Mary



On Tue, Mar 21, 2017 at 12:51 PM, Mary Haley <haley at ucar.edu> wrote:

> Zhifeng,
>
> I still can't reproduce this problem using the numbers you gave me.  I get
> exponential labels by default, using either a vertical or horizontal
> labelbar.
>
> Can you try the attached program and let me know what you get?
>
> It would help if I can get your data and script.
>
> If you are calling gsn_csm_contour or gsn_csm_contour_map, then you can
> set the following special resource:
>
> res at gsnDebugWriteFileName = "formary"
>
> and it will cause the data that is being contoured to be written to a
> NetCDF file called "formary.nc", and it will create a pared down NCL
> script that you can send me called formary.ncl.
>
> You can send me the two files offline if you like, or use our ftp:
>
> http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP
>
> Thanks,
>
> --Mary
>
>
>
> On Mon, Mar 20, 2017 at 10:16 AM, Zhifeng Yang <yangzf01 at gmail.com> wrote:
>
>> Hi Mary,
>>
>> Maybe it’s better to tell you the maximum and minimum data. The data
>> range from -0.00001 to 0.00001. And I want contour levels with 0.0000001
>> interval. If you have any data in hand, you can simply divid by a big
>> number for the whole data, then get very small data, then you can draw with
>> very small data.
>>
>> Thank you for your concern, Mary.
>>
>> Zhifeng
>>
>> On Mar 20, 2017, at 10:40 AM, Mary Haley <haley at ucar.edu> wrote:
>>
>> Zhifeng,
>>
>> What you are setting looks correct.
>>
>> I was going to try to create an example so I could make sure this
>> resource works as expected, but it's hard to get NCL to do a mix of
>> exponential and fractional labels.
>>
>> Can you either provide the data you are trying to contour or else tell me
>> what the exact min/max is of your data, and what contour levels you are
>> using, and I'll see if I can reproduce the problem.
>>
>> Thanks,
>>
>> --Mary
>>
>>
>> On Sun, Mar 19, 2017 at 8:01 PM, Zhifeng Yang <yangzf01 at gmail.com> wrote:
>>
>>> Hi Dennis,
>>>
>>> I tried
>>>
>>> cres at cnLineLabelFormat= "0@!;*^se"
>>> But it doesn’t work. I also used other combination. It seems no effect
>>> at all.
>>>
>>> Thank you
>>> Zhifeng
>>>
>>> On Mar 19, 2017, at 6:53 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>
>>> http://www.ncl.ucar.edu/Applications/tickmarks.shtml
>>> Example 8
>>>
>>> may be what you want.
>>>
>>> On Sun, Mar 19, 2017 at 4:01 PM, Zhifeng Yang <yangzf01 at gmail.com>
>>> wrote:
>>>
>>>> Hi
>>>>
>>>> I use some very small numbers to plot contour image. Since they are
>>>> very small, like -0.000001, the label bar looks very wield. So I want to
>>>> display the small number as exponential format on the label bar, such as
>>>> -1.0e(-6) or -1.0*10^-6, rather than -0.000001. Do you have any ideas?
>>>>
>>>> Thank you
>>>> Zhifeng
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> 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/20170322/2d45d703/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_labelbar_630.ncl
Type: application/octet-stream
Size: 9854 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170322/2d45d703/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_labelbar_640.ncl
Type: application/octet-stream
Size: 11541 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170322/2d45d703/attachment-0001.obj 


More information about the ncl-talk mailing list