[ncl-talk] Placing numbers above the bars

Barry Lynn barry.h.lynn at gmail.com
Tue Feb 19 11:09:10 MST 2019


Hello:

I was a bit surprised do see that there are numbers above the bars now.

However, they are there, so I must have really benefited from the
information on these two pages.

http://www.ncl.ucar.edu/Applications/Scripts/bar_horz_7.ncl

https://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_text.shtml

Yet, I am wondering how I might create a bit of space between the bars and
the labels, and how I might grow the labels (numbers) themselves?

Thank you,

Barry

On Tue, Feb 19, 2019 at 5:33 PM Mary Haley <haley at ucar.edu> wrote:

>
> Barry,
>
> You can also use gsn_add_text or gsn_text to place the text above the bar,
> using the max value of the bar and the X axis position.
>
> There are some examples. See bar_7.ncl at:
>
> http://www.ncl.ucar.edu/Applications/bar.shtml#ex7
>
> Histograms are slightly different, but there are also several examples of
> labeling the bars:
>
> http://www.ncl.ucar.edu/Applications/histo.shtml
>
> See #12, and #16. This is mainly to give you some ideas of different ways
> to label a bar.
>
> --Mary
>
>
>
>
> On Sun, Feb 17, 2019 at 9:17 AM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Barry,
>>
>> You might be able to use "datatondc()" to get the NDC coordinates of the
>> tops of the bars, and then use gsn_text_ndc() to draw your annotation
>> (applying a small offset in x and/or y direction to properly position it).
>> The example on the datatondc() does something similar, but with markers
>> rather than text.
>>
>>     http://ncl.ucar.edu/Document/Functions/Built-in/datatondc.shtml
>>     http://ncl.ucar.edu/Document/Graphics/Interfaces/gsn_text_ndc.shtml
>>
>> Hope that helps...
>> Rick
>> On Sat, Feb 16, 2019 at 11:05 PM Barry Lynn <barry.h.lynn at gmail.com>
>> wrote:
>>
>>> Hello:
>>>
>>> I have a bar chart attached.
>>>
>>> I would like to place a number (I will generate it) above the position
>>> of the bar highest bar, centered at each labeled (x-axis) interval.
>>>
>>> Is there a straightforward way to do this?
>>>
>>> Thanks,
>>>
>>> Barry
>>>
>>> --
>>> Barry H. Lynn, Ph.D
>>> Senior Associate Scientist, Lecturer,
>>> The Institute of the Earth Science,
>>> The Hebrew University of Jerusalem,
>>> Givat Ram, Jerusalem 91904, Israel
>>> Tel: 972 547 231 170
>>> Fax: (972)-25662581
>>>
>>> C.E.O, Weather It Is, LTD
>>> Weather and Climate Focus
>>> http://weather-it-is.com
>>> Jerusalem, Israel
>>> Local: 02 930 9525
>>> Cell: 054 7 231 170
>>> Int-IS: x972 2 930 9525
>>>
>>> _______________________________________________
>>> 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
>>
>

-- 
Barry H. Lynn, Ph.D
Senior Associate Scientist, Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190219/da15b480/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bars.png
Type: image/png
Size: 79226 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190219/da15b480/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_label.ncl
Type: application/octet-stream
Size: 4262 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190219/da15b480/attachment-0001.obj>


More information about the ncl-talk mailing list