comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Histogram: Normalised Occurrence Frequency
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Histogram: Normalised Occurrence Frequency [message #59009] Thu, 28 February 2008 07:50
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
hazel wrote:
> Hi All,
>
> I want to plot a histogram where the number of samples in each bin are
> normalised by the total number of samples across all bins.
>
> Currently I use David's 'HISTOPLOT' and the REVERSE_INDICIES keyword
> to get the indicies in each bin. Then Jaco's HISTOBIN to count these
> for each bin.
n_elements(your_input) is the total number of samples (unless you have
NANs as missing elements, in that case you may have to use the finite
function to find out
the number of non-NANs)

Paolo
>
> Then I normalise the bin totals and have to plot number of bins vs.
> normalised values using Plot and Psym=10.
>
> Is there an easier way to do this? Also how would I use HISTOPLOT to
> replot this normalised hist as I can't seem to get it to work.
>
> Thanks,
>
>
> Hazel
Re: Histogram: Normalised Occurrence Frequency [message #59011 is a reply to message #59009] Thu, 28 February 2008 07:43 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Hazel writes:

> I want to plot a histogram where the number of samples in each bin are
> normalised by the total number of samples across all bins.
>
> Currently I use David's 'HISTOPLOT' and the REVERSE_INDICIES keyword
> to get the indicies in each bin. Then Jaco's HISTOBIN to count these
> for each bin.

Say what!? Isn't the count in each bin the, uh, histogram?

I would think a normalized histogram plot looks like this:

Plot, Histogram(data)/Total(Histogram(data))

> Then I normalise the bin totals and have to plot number of bins vs.
> normalised values using Plot and Psym=10.
>
> Is there an easier way to do this? Also how would I use HISTOPLOT to
> replot this normalised hist as I can't seem to get it to work.

Maybe I'll add a NORMALIZED keyword. I found a couple of other
oddities with HISTOPLOT the other day. I'll have to have a look
at it, but right now, I have to get to work. Maybe there will be
something new this weekend. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Histogram: Normalised Occurrence Frequency
Next Topic: Regarding the Fit_Ellipse Program

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:01:27 PDT 2025

Total time taken to generate the page: 0.48038 seconds