Plot vertical lines in a figure with a certain distance
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi, I would like to plot vertical dotted lines on a figure. These should be placed after every 60 units on the x axis.
댓글 수: 0
채택된 답변
Star Strider
2017년 10월 14일
Try this:
x = linspace(0,1, 250); % Create Data
y = 5+randn(size(x)); % Create Data
figure(1)
plot(x, y)
hold on
VLX = repmat(x(60:60:end), 2, 1); % Vertical Line ‘x’ Locations
VLY = repmat(ylim, size(VLX,2), 1)'; % Vertical Line ‘y’
plot(VLX, VLY, 'LineWidth', 1.5)
hold off
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!