Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Obtain a vertical line at the point clicked to show selected segments
Date: Fri, 22 May 2009 16:09:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gv6in2$4c9$1@fred.mathworks.com>
References: <gv51lh$k6s$1@fred.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243008546 4489 172.30.248.37 (22 May 2009 16:09:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 22 May 2009 16:09:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:541825


Hello Mohammed,

If you have your plot ready, you could do the following. But IMPORTANT: You need to press enter after you make a SINGLE selection. If you click more than once, you may have trouble. If you would like to plot multiple vertical lines, then you had better put this in a for loop or the like, and each time make a single selection and press enter. This code draws a vertical red line.

[x,y] = ginput;  %
yLims = get(gca,'YLim');
hold on
line([x,x],yLims,'Color','red')





<gv51lh$k6s$1@fred.mathworks.com>...
> Hi all,
> 
> I have been trying to find out a way to draw a vertical line after I click on certain area on a plot to distinguish between selected segments on a timeseries without much success. Could anyone please help me with this or know where'd I get resrouce regarding this? The purpose of this is to make sure when I select segment from a timeseries, I don't select a portion twice or they dont overlap. I highly appreiciate your time and effort. Have a good one.