|
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.
|