MATLAB Answers

AA
0

denoting vertical lines with numbers

Asked by AA
on 23 Nov 2017
Latest activity Answered by KSSV
on 23 Nov 2017
Accepted Answer by KSSV
VLX = repmat(xy(60:60:end), 2, 1); % Vertical Line ‘x’ Locations
VLY = repmat(ylim, 24, 1)'; % Vertical Line ‘y’
% h=gcf; set(h.Children,'Xlim',[min_after_mn(f,1)-200 min_after_mn(f,1)+60]);
plot(VLX,VLY)
Hi, the above code draws vertical lines on my plot. I want to give every vertical line a number independent of the x axis. is that possible? for instance, line 1 is denoted as 1, linte 2 is denoted as 2 and so on...

  0 Comments

Sign in to comment.

1 Answer

Answer by KSSV
on 23 Nov 2017
 Accepted Answer

Read about text.
k = repmat(1:10,10,1) ;
%%number the line
x = ones(10,1) ; y = (1:10)' ;
plot(k)
hold on
text(x,y,num2str(y))

  0 Comments

Sign in to comment.