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

Home » Public Forums » archive » Re: Array plotting and segmentation
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: Array plotting and segmentation [message #59865] Tue, 15 April 2008 07:05
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Apr 14, 12:54 pm, Vince Hradil <hrad...@yahoo.com> wrote:
> On Apr 14, 11:47 am, Conor <cmanc...@gmail.com> wrote:
>
>
>
>> On Apr 14, 10:57 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>>> On Apr 14, 9:16 am, moxam...@gmail.com wrote:
>
>>>> Dear All,
>
>>>> I have the following problem:
>
>>>> I have an array lets say A = [3,4,6,8,3,2,5,7,10,5,4]. As you can see,
>>>> in this array we have two peaks (8 and 10) and one gap (2). I want to
>>>> plot this array and draw a line on the gap element (which is in 2)
>>>> vertical on the x axes and parallel to the y axes. In other words, I
>>>> want to segment the the curve produced by plotting the array by
>>>> drawing a line on the gap element.
>
>>>> Any help will be appreciated.
>
>>>> Thank you very much in advance,
>
>>>> Dabboor
>
>>> Is this what you want:
>
>>> idx = (where(A eq min(A)))[0]
>>> plot, A
>>> plots, [idx,idx], !y.crange
>
>> The slightly quicker way to find the minimum is to just use the second
>> parameter to the min() function:
>
>> minval = min( A, idx )
>
> I always forget that - does it return the first index or an array of
> indexes?

Just the first, unless you use the dimension keyword.
Re: Array plotting and segmentation [message #59875 is a reply to message #59865] Mon, 14 April 2008 09:54 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 14, 11:47 am, Conor <cmanc...@gmail.com> wrote:
> On Apr 14, 10:57 am, Vince Hradil <hrad...@yahoo.com> wrote:
>
>> On Apr 14, 9:16 am, moxam...@gmail.com wrote:
>
>>> Dear All,
>
>>> I have the following problem:
>
>>> I have an array lets say A = [3,4,6,8,3,2,5,7,10,5,4]. As you can see,
>>> in this array we have two peaks (8 and 10) and one gap (2). I want to
>>> plot this array and draw a line on the gap element (which is in 2)
>>> vertical on the x axes and parallel to the y axes. In other words, I
>>> want to segment the the curve produced by plotting the array by
>>> drawing a line on the gap element.
>
>>> Any help will be appreciated.
>
>>> Thank you very much in advance,
>
>>> Dabboor
>
>> Is this what you want:
>
>> idx = (where(A eq min(A)))[0]
>> plot, A
>> plots, [idx,idx], !y.crange
>
> The slightly quicker way to find the minimum is to just use the second
> parameter to the min() function:
>
> minval = min( A, idx )

I always forget that - does it return the first index or an array of
indexes?
Re: Array plotting and segmentation [message #59876 is a reply to message #59875] Mon, 14 April 2008 09:47 Go to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Apr 14, 10:57 am, Vince Hradil <hrad...@yahoo.com> wrote:
> On Apr 14, 9:16 am, moxam...@gmail.com wrote:
>
>
>
>> Dear All,
>
>> I have the following problem:
>
>> I have an array lets say A = [3,4,6,8,3,2,5,7,10,5,4]. As you can see,
>> in this array we have two peaks (8 and 10) and one gap (2). I want to
>> plot this array and draw a line on the gap element (which is in 2)
>> vertical on the x axes and parallel to the y axes. In other words, I
>> want to segment the the curve produced by plotting the array by
>> drawing a line on the gap element.
>
>> Any help will be appreciated.
>
>> Thank you very much in advance,
>
>> Dabboor
>
> Is this what you want:
>
> idx = (where(A eq min(A)))[0]
> plot, A
> plots, [idx,idx], !y.crange

The slightly quicker way to find the minimum is to just use the second
parameter to the min() function:

minval = min( A, idx )
Re: Array plotting and segmentation [message #59878 is a reply to message #59876] Mon, 14 April 2008 07:57 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Apr 14, 9:16 am, moxam...@gmail.com wrote:
> Dear All,
>
> I have the following problem:
>
> I have an array lets say A = [3,4,6,8,3,2,5,7,10,5,4]. As you can see,
> in this array we have two peaks (8 and 10) and one gap (2). I want to
> plot this array and draw a line on the gap element (which is in 2)
> vertical on the x axes and parallel to the y axes. In other words, I
> want to segment the the curve produced by plotting the array by
> drawing a line on the gap element.
>
> Any help will be appreciated.
>
> Thank you very much in advance,
>
> Dabboor

Is this what you want:

idx = (where(A eq min(A)))[0]
plot, A
plots, [idx,idx], !y.crange
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to display shape file in a windows
Next Topic: for loops and calls to functions/objects

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

Current Time: Fri Oct 10 00:42:29 PDT 2025

Total time taken to generate the page: 0.87870 seconds