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

Home » Public Forums » archive » Finding peak with cgHistoplot and bin confusion
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: Finding peak with cgHistoplot and bin confusion [message #87112 is a reply to message #87111] Wed, 08 January 2014 05:59 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
rjp23@le.ac.uk writes:

>
> I'm using cgHistoplot with the binsize value set like so:
>
> cgHistoplot, data, binsize=100, xrange=[0, 8000]
>
> Is there a simple way to find the x value where the histogram peaks?
>
> I thought using the histdata keyword would have worked and then something like find=where(histdata EQ max(histdata)).
>
> The problem though is then knowing which bin that subscript refers to. I assumed because I specify xrange starting from 0 then my first bin would be 0-99. However, if I use the omin keyword it returns a value of 698.045. Does that mean by first bin is 600-699? or 698.045-797.045?

I would do something like this:

cgHistoplot, data, binsize=100, xrange=[0, 8000], HistData=d
maxValue = Max(d, binNumber)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Missing value and Image size in Image, Function Graphic
Next Topic: Thickness of Errorbar

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

Current Time: Fri Oct 10 03:41:33 PDT 2025

Total time taken to generate the page: 0.48035 seconds