[ncl-talk] At the top of this page on histograms

Mary Haley haley at ucar.edu
Mon Mar 19 10:16:53 MDT 2018


Hi Barry,

The reason why those particular labels are directly centered under the bars
is because discrete values are being used. That is, the histogram is
counting the number of values *equal* to specific values, rather than in a
range of values.  You can see this from looking at this resource setting in
the histo_3.ncl code:

  res at gsnHistogramDiscreteBinValues  = ispan(0,25,1)

This will bin the values by counting the number of values exactly equal to
0, exactly equal to 1, and so on up to 25.

The labels under the tickmarks are not labelbar tickmarks, since there is
no labelbar in this case. These bars are drawn using filled polygons and
not labelbars.

To change these labels, you need to set tickmark (tm) resources, in
particular, tmXBLabels. Here, I'm adding an equal sign to the front of
every value:

  res at tmXBLabels           = "=" + res at gsnHistogramDiscreteBinValues
  res at tmXBLabelFontHeightF = 0.01
  res at tmXBLabelStride      = 1


Note that I also set tmXBLabelStride to 1, because in histo_3.ncl, only
every other bar was labeled.

--Mary



On Sun, Mar 18, 2018 at 11:09 PM, Barry Lynn <barry.h.lynn at gmail.com> wrote:

> Hi:
>
> https://www.ncl.ucar.edu/Applications/histo.shtml
>
> is  histogram where the labels appear under the bars.
>
> However, I can't seem to find the setting for this.
>
> The default appears to be between
>
> and:
>
> res at lbLabelAlignment     = "BoxCenters"
>
>
> is not a recognized resource,
>
> so changing this to ExteriorEdges doesn't help.
>
> Thank you,
>
> Barry
> --
> Barry H. Lynn, Ph.D
> Senior 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
> US 914 432 3108 <(914)%20432-3108>
>
> _______________________________________________
> 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/20180319/7732a4b3/attachment.html>


More information about the ncl-talk mailing list