Plot vertical lines in a figure with a certain distance

2 ビュー (過去 30 日間)
AA
AA 2017 年 10 月 14 日
編集済み: AA 2017 年 10 月 26 日
Hi, I would like to plot vertical dotted lines on a figure. These should be placed after every 60 units on the x axis.

採用された回答

Star Strider
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 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by