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

Home » Public Forums » archive » histogram function question
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 function question [message #90524 is a reply to message #90517] Fri, 06 March 2015 08:08 Go to previous messageGo to previous message
Burch is currently offline  Burch
Messages: 28
Registered: December 2013
Junior Member
On Friday, March 6, 2015 at 8:03:05 AM UTC-6, Dae-Kyu Shin wrote:
> hi
>
> here is a example code
>
>
> data = [0, 0.3, 1.3d]
> h1 = HISTOGRAM(data, nbin=3, min=0, max=1, loc=loc1)
> h2 = HISTOGRAM(data, binsize=0.5d, min=0, max=1, loc=loc2)
>
> print, h1
> print, h2
>
> h1 = 2 0 1
> h2 = 2 0 0
>
>
> h1 and h2 is not equal!!
> is it correct??
>
>
> thanks

There is a note in the documentation for the MAX keyword:

"Note: If NBINS is specified, the value for MAX will be adjusted to NBINS*BINSIZE + MIN. This ensures that the last bin has the same width as the other bins."

So it seems for h1 BINSIZE is calculated to be

(max - min)/(nbins-1) = 0.5

and then max is adjusted to

nbins*binsize + min = 1.5,

whereas in h2 there is no *internal* adjustment to MAX.

-Jeff
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WIDGET_TABLE and /ALL_EVENTS
Next Topic: map projection

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

Current Time: Wed Oct 08 20:14:16 PDT 2025

Total time taken to generate the page: 0.00432 seconds