RE: [ncl-talk] Retrieving x values of a histogram [SEC=UNCLASSIFIED]

From: Harun Rashid <H.Rashid_at_nyahnyahspammersnyahnyah>
Date: Fri, 16 Nov 2007 11:02:55 +1100

 
Hi Mary,

Thanks very much. Your suggestion works perfectly.

Cheers,
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
===================================================================
 

-----Original Message-----
From: Mary Haley [mailto:haley_at_ucar.edu]
Sent: Thursday, 15 November 2007 03:44
To: Harun Rashid
Cc: ncl-talk_at_ucar.edu
Subject: Re: Retrieving x values of a histogram
[SEC=UNCLASSIFIED]

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
> ===================================================================
>
>
>
Received on Thu Nov 15 2007 - 17:02:55 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 25 2007 - 07:21:25 MST