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

Home » Public Forums » archive » Re: There is NO TRUTH! Re: Histogram Hot-shots Required
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: There is NO TRUTH! Re: Histogram Hot-shots Required [message #16349 is a reply to message #16346] Tue, 20 July 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:

> The following procedure from the Astronomy library seems to do a pretty
> good job of computing and plotting histograms:
> http://www.astro.washington.edu/deutsch-bin/getpro/library01 .html?PLOTHIST

I tried this in my application. Indeed, it does a
*pretty* good job, but it is not always accurate.
I found it about as accurate as ROUNDing the
bin number.

I think most people who have struggled with this
problem have realized that the PLOT command in
Histogram mode (PSYM=10) is about half a bin
from what you really want. In other words,
the histogram "bar" is not positioned over the
values that are in that particular bin, but is
offset by half a bin size.

Some people correct this by adding half a binsize
to the bins when they draw the plot:

PLOT, bins+binsize/2, Histogram(data)

That is close enough for government work, but
it doesn't cut it when you need complete accuracy.
I think you would only really discover that this
method *wasn't* accurate if you are drawing the
real value on the graph, as I was in this application.
This would be especially true if your histogram
was fairly smooth. Mine happened to be missing
certain values, which made the problem especially
apparent to me.

I'm really of the mind that the only way to solve
this problem is to hand-draw your own histogram bars
at the edges of the actual bin values.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Seeking IDL Programmers with Interests in Coastal Oceanography/Geology
Next Topic: Re: CALL_EXTERNAL failure.

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

Current Time: Sun Oct 12 07:16:14 PDT 2025

Total time taken to generate the page: 0.47928 seconds