Re: Retrieving x values of a histogram [SEC=UNCLASSIFIED]

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 14 Nov 2007 09:43:36 -0700 (MST)

Hi Harun,

There's no way to get these values automatically, but you can edit
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" directly and where
you see the following lines:

   histogram_at_NumInBins = num_in_bins
   histogram_at_NumMissing = num_in_bins_at_NumMissing
   histogram_at_Percentages = num_in_bins_at_percentages
   histogram_at_PercentagesNoMissing = num_in_bins_at_percentages_nm
   return(histogram)

add this line to the top:

   histogram_at_BinLocs = num_in_bins_at_binlocs

You can then use the "BinLocs" attribute for the information you need.
This will give you the endpoints if you have intervals, or the exact
values if you have discrete values.

I will make sure this code gets updated to return this
attribute for V5.0.1.

--Mary

On Wed, 14 Nov 2007, Harun Rashid wrote:

> Hi,
>
> I'm wondering if there is any way of getting the x values (i.e.,
> locations of the bin centers) from gsn_histogram. I know that I can get
> the x positions in plot coordinates as plot_at_MidBarLocs
> <mailto:plot_at_MidBarLocs> . But I need the actual x values, in order to
> compute a theoretical histogram corresponding to the data histogram
> plotted by gsn_histogram. Of course, I can define the x values, e.g., by
> looking at the plotted histogram. But, it would be nice to be able to
> somehow get the values used by gsn_histogram. Any idea would be
> appreciated. Thanks.
>
> --
> Harun
>
>
> ===================================================================
> Dr. M. Harun Ar Rashid
> Bureau of Meteorology Research Centre Email: h.rashid_at_bom.gov.au
>
> PO Box 1289K Tel : +61 3
> 9669 4550
> Melbourne, Victoria 3001 Fax : +61 3 9669
> 4660
> Australia
> http://www.bom.gov.au/bmrc
> ===================================================================
>
>
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 14 2007 - 09:43:36 MST

This archive was generated by hypermail 2.2.0 : Wed Nov 14 2007 - 10:07:00 MST