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

Home » Public Forums » archive » Re: How can i get the co-ordinates of the peaks in a plot?
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: How can i get the co-ordinates of the peaks in a plot? [message #50332 is a reply to message #50321] Mon, 25 September 2006 05:05 Go to previous messageGo to previous message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
zircola wrote:
> I used max function to get the y value but don't know how to get the
> corresponding x value and how to get the xy value of the more than one
> peaks. please help. thanks:)

An optional argument for max is max_subscript. Set this to a named
variable to get the index of the array that contains the maximum value.
Then it's as simple as subscripting your x array with that named
variable.

y_val=max(y, max_index, /abs)
x_val=x[max_index]
print, 'The maximum occured at ', x_val, ' and had a value of ', y_val
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Closing out of a Window
Next Topic: How can i get the co-ordinates of the peaks in a plot?

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

Current Time: Sat Oct 11 09:46:38 PDT 2025

Total time taken to generate the page: 1.36357 seconds