Thread Subject: Obtain a vertical line at the point clicked to show selected segments

Subject: Obtain a vertical line at the point clicked to show selected segments

From: Mohammed Islam

Date: 22 May, 2009 02:12:01

Message: 1 of 2

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.

Subject: Obtain a vertical line at the point clicked to show selected segments

From: Sadik

Date: 22 May, 2009 16:09:06

Message: 2 of 2

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.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com