Re: specific lebels for Histograms

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 15 Mar 2007 08:52:55 -0600 (MDT)

Hi Carlos,

There's no automatic way to do this with histograms, because the values
on the X axis are not index values, but rather floating point values
that are calculated internally in order to position the bars.

However, in next version of NCL, I have added code that returns those
internal values so you can use them for the tmXBValues array. This
requires you to first call gsn_histogram to create the histogram,
and then you can retrieve these internal values, which are
stored in an attribute called "MidBarLocs". I hope in the future to
make it so you don't have to do this extra step.

I've attached the new "gsn_code.ncl" and "gsn_csm.ncl" scripts so you
don't have to wait for this new version, and also an example program
"h.ncl" to show how to use the MidBarLocs array. Send me a personal
email if you have trouble with these scripts.

--Mary

On Wed, 14 Mar 2007, Carlos Manuel Minjarez-Sosa wrote:

> Dear all, I am trying to put specific levels to a histogram but when I
> run my program it just appear the first lebel and no the others and in
> my prompt does not say any warning or error. Here is what I am doing:
>
> Thanks
> carlos
>
> wks = gsn_open_wks("x11","histo") ; open workstation
> gsn_define_colormap(wks,"temp1") ; choose colormap
>
> res = True
> res_at_tmXBLabelStride = 3
> res_at_tmXBMode = "Explicit" ; define own tock marl lebels
> res_at_gsnHistogramDiscreteBinValues = ispan(0,23,1)
> res_at_tmXBLabelAngleF = 300.
> ;res_at_tmXBValues =(/0,3,6,9,12,15,18,21/) ;LOcation of explicit
> labels
> ;res_at_tmXBLabels = (/"0-5 P.M.","3-8 P.M.","6-11 P.M.","9-2
> A.M.","12-5 A.M.","15-8 A.M.","18-11 A.M.","21-2 P.M."/)
> res_at_tmXBMinorOn = False ; No minor tick marks.
> res_at_tmXBLabelJust = "CenterCenter" ; label justification
> res_at_tmXBLabelFontHeightF = .03 ; Font size
>
>
> plot =gsn_histogram(wks,hour,res); create histogram with 10 bins
>
> --
> Carlos Manuel Minjarez-Sosa <minjarez_at_jet.atmo.arizona.edu>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Thu Mar 15 2007 - 08:52:55 MDT

This archive was generated by hypermail 2.2.0 : Fri Mar 16 2007 - 08:51:26 MDT