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

Home » Public Forums » archive » Re: How to use max() to plot where in the plot max is located ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to use max() to plot where in the plot max is located ? [message #31822] Thu, 22 August 2002 18:51
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst (paul.vandelst@noaa.gov) writes:

> uh - yeah, umm, look closer. I wasn't replying to your post. I was replying to the OP's
> reply to your pseudo-code using reply.

Oh, oh. Sorry, Paul. I'm multi-tasking these days,
with the start of tennis season. I must have had
my mind on the 23 Freshmen and Sophomores on our
team of thirty. :-(

I promise to read more closely this weekend. :-)

Cheers,

David

P.S. Let's just say my backhand doesn't look too
bad, considering.

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: How to use max() to plot where in the plot max is located ? [message #31823 is a reply to message #31822] Thu, 22 August 2002 15:07 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
>
> Paul van Delst (paul.vandelst@noaa.gov) writes:
>
>> From your previous code, I assume you meant:
>>
>> max308=max(data(3,*), maxindex)
>> max353=max(data(5,*), maxindex)
>>
>> but what if the maximum value for the different columns of data occurs at a different
>> index? Shouldn't you do something like,
>>
>> max308=max(data(3,*), max308index)
>> max353=max(data(5,*), max353index)
>>
>> ??
>>
>> If not, why bother with returning maxindex for data(3,*)?
>>
>> me confuzzed.
>
> I was using *pseudo* code.

uh - yeah, umm, look closer. I wasn't replying to your post. I was replying to the OP's
reply to your pseudo-code using reply. His "with-a-twist" solution was overwriting the
same maxindex variable but for a different set of data.

> That is meant to be confusing.

I must have snipped the "Kolbjorn Bekkelund wrote:" part from my reply.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC Beer is good.
Ph: (301)763-8000 x7274 My wife.
Fax:(301)763-8545
Re: How to use max() to plot where in the plot max is located ? [message #31824 is a reply to message #31823] Thu, 22 August 2002 13:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst (paul.vandelst@noaa.gov) writes:

> From your previous code, I assume you meant:
>
> max308=max(data(3,*), maxindex)
> max353=max(data(5,*), maxindex)
>
> but what if the maximum value for the different columns of data occurs at a different
> index? Shouldn't you do something like,
>
> max308=max(data(3,*), max308index)
> max353=max(data(5,*), max353index)
>
> ??
>
> If not, why bother with returning maxindex for data(3,*)?
>
> me confuzzed.

I was using *pseudo* code. That is meant to be confusing.
But I find it cuts the future questions way down, so I
can't afford to give it up. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: How to use max() to plot where in the plot max is located ? [message #31825 is a reply to message #31824] Thu, 22 August 2002 13:09 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Kolbjorn Bekkelund wrote:
>
> Thanks David.
>
> It worked with a little twist:
>
> max308=max(data(3,*), maxindex)
> max353=max(data(3,*), maxindex)

From your previous code, I assume you meant:

max308=max(data(3,*), maxindex)
max353=max(data(5,*), maxindex)

but what if the maximum value for the different columns of data occurs at a different
index? Shouldn't you do something like,

max308=max(data(3,*), max308index)
max353=max(data(5,*), max353index)

??

If not, why bother with returning maxindex for data(3,*)?

me confuzzed.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC Beer is good.
Ph: (301)763-8000 x7274 My wife.
Fax:(301)763-8545
Re: How to use max() to plot where in the plot max is located ? [message #31826 is a reply to message #31825] Thu, 22 August 2002 12:13 Go to previous message
Kolbjorn Bekkelund is currently offline  Kolbjorn Bekkelund
Messages: 20
Registered: August 2002
Junior Member
No Message Body
Re: How to use max() to plot where in the plot max is located ? [message #31829 is a reply to message #31826] Thu, 22 August 2002 09:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kolbjorn Bekkelund (kobe@rocketrange.no) writes:

> The file read in below conatins 14 lines of header info read into the
> header variable. Below these I've got about 1000 lines of 7 coloum
> floats. The snip of my program below plots the selected info in ok curves
> and adds info with xyouts about the max and min value of those. BUT; I
> would like to add a sign or a vertical bar going through the point of
> maximum.
>
> How do I do that ?

Use the second positional parameter to your MAX and MIN
functions to get the indices where the maximum or
minimum occurs:

min308=min(data(3,*), maxindex)
max308=max(data(3,*), minindex)

Then, just draw some kind of symbol on your plot. Say,
a big asterisk:

PLOTS,((data(3,*))[maxindex]/shots/0.0974),$
(data(2,*))[maxindex], color=166, PSYM=2, $
SYMSIZE=2.5

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: widget events and dlms
Next Topic: Re: switch colortable

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

Current Time: Fri Oct 10 10:30:16 PDT 2025

Total time taken to generate the page: 0.32216 seconds