![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/352457/image.png)
Plotting a line x=constant
조회 수: 100 (최근 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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/352457/image.png)
채택된 답변
추가 답변 (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
Svitlana Strunina
2021년 3월 29일
xline(3);
https://www.mathworks.com/help/matlab/ref/xline.html
댓글 수: 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!