Plotting a line x=constant
古いコメントを表示
Hi,
What is a good way to plot a straight line parallel to y-axis for a particular x value?
I've used this code but the line is dotted
x=3;
y=0:0.001:0.3; %How much is long
plot(x, y, 'LineWidth', 10) % but is not large enough
1 件のコメント
Ram Lakha Meena
2020 年 8 月 27 日
This is what i did and the result:
clear
clc
close all
x=3;
y=0:0.001:0.3; %How much is long
plot(x, y, 'LineWidth', 10) % but is not large enough

採用された回答
その他の回答 (3 件)
Francisco Williams
2020 年 8 月 24 日
2 投票
You can use xline command
Paulo Silva
2011 年 9 月 21 日
plot(x*ones(size(y)), y, 'LineWidth', 10)
or
plot(x*ones(1,size(y,2)), y, 'LineWidth', 10)
Svitlana Strunina
2021 年 3 月 29 日
1 投票
xline(3);
https://www.mathworks.com/help/matlab/ref/xline.html
カテゴリ
ヘルプ センター および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!