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

Barry Lynn barry.h.lynn at gmail.com
Mon Mar 19 11:03:10 MDT 2018


Hello:

Thank you for the suggestion.

I've tried a few things, but the problem I have is that I need the labels
to be equal to the values in the variable "intervals."

intervals = ((/8,12,18,24,30,36,50,75,100/))


where the right most value displayed on the histogram is 75.


I tried setting


res at gsnHistogramDiscreteBinValues  = intervals

but I get this error.

0) Error: gsn_histogram: The bin values you picked are out of range. No
plot will be drawn.

(0) Error: gsn_histogram: The bin values you picked are out of range. No
plot will be drawn.

If I set the discrete values this way, I get this error.


res at gsnHistogramDiscreteBinValues  =
ispan(intervals(0),intervals(n_int-1),1)


0) Error: gsn_histogram: The bin values you picked are out of range. No
plot will be drawn.

(0) Error: gsn_histogram: The bin values you picked are out of range. No
plot will be drawn.



On Mon, Mar 19, 2018 at 6:16 PM, Mary Haley <haley at ucar.edu> wrote:

> 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
>>
>>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180319/a657c591/attachment.html>


More information about the ncl-talk mailing list