Plotting a line x=constant
114 次查看(过去 30 天)
显示 更早的评论
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 个)
Paulo Silva
2011-9-21
plot(x*ones(size(y)), y, 'LineWidth', 10)
or
plot(x*ones(1,size(y,2)), y, 'LineWidth', 10)
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!