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 #87113 is a reply to message #87112] Wed, 08 January 2014 06:33 Go to previous messageGo to previous message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
On Wednesday, January 8, 2014 1:59:29 PM UTC, David Fanning wrote:
>
> I would do something like this:
>
>
>
> cgHistoplot, data, binsize=100, xrange=[0, 8000], HistData=d
>
> maxValue = Max(d, binNumber)
>

Hi David,

Sorry I don't think I explained very well. What you've posted there is just the equivalent of find=where(histdata EQ max(histdata)) isn't it?

What is causing me trouble is then using the returned bin subscript to get the correct bin value.

I think my problem is that I assumed that the first bin was at the bottom of my xrange but it's actually at the bottom of my data range (I think?).

If I do this it looks like it works to get to the middle of the bin in which the distribution peaks:

peak=omin+binsize*find+binsize/2.
[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: Thu Oct 09 21:56:21 PDT 2025

Total time taken to generate the page: 0.40416 seconds