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

Home » Public Forums » archive » Re: histogram and binsize problems
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: histogram and binsize problems [message #34247 is a reply to message #34246] Thu, 27 February 2003 11:26 Go to previous messageGo to previous message
Chad Bender is currently offline  Chad Bender
Messages: 21
Registered: July 2001
Junior Member
> You may wish to check out the HIST_PLOT procedure I wrote as an example
> program for my book (Chapter 6, pp 260-262):

Thanks for the suggestions. Liam, your routine gives me the same result
as I was getting with just:
plot, findgen(31), histogram(data,min=0.0,max=0.15,binsize=0.005), psym=10

I looked through it briefly, and it is doing enough strange things to
convience me that how histogram sets up its bins is not trivial. However,
using it does not get rid of the bins with value 0.

I tried a few other things to see if I could figure out something of what
histogram is doing. It's obvious from something like the following that
histogram has rounding issues at the bin boundaries.
IDL> test=findgen(31)*0.005
IDL> plot, test, histogram(test, min=0.0, max=0.15, binsize=0.005),
psym=10
IDL> plot, test, histogram(test, binsize=0.005), psym=10

But from expanding the min and max by +-binsize/2, I get almost the
expected result
IDL> hist=histogram(test, min=-0.0025, max=0.1525, binsize=0.005)
IDL> help, hist
HIST LONG = Array[32]
IDL> plot, findgen(32)*0.005, hist, psym=10, ystyle=3, xstyle=3

From this I can see that the last bin is empty. It
falls outside the range I specified by min and max (ie. it covers
0.1525-0.1575). So why does IDL create it at all?

Chad


--
#############################
Chad Bender
Dept of Physics and Astronomy
SUNY Stony Brook
cbender@mail.astro.sunysb.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is PDF the only help option in 5.6?
Next Topic: Matrix op speaks. Computer programmers needed to build matrix.

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

Current Time: Wed Oct 08 16:51:35 PDT 2025

Total time taken to generate the page: 0.00424 seconds