Hello,
How do I plot vercicle lines that go up to y-value 10?
thanks in advance

 채택된 답변

John D'Errico
John D'Errico 2020년 11월 30일
편집: John D'Errico 2020년 11월 30일

0 개 추천

Plot two points, connected by a line. Both points will have the same value for x. You can choose the start and end point in y to plot. Don't use a marker. WTP?
Or, you could use the function xline.

댓글 수: 4

Jens Petit-jean
Jens Petit-jean 2020년 11월 30일
yeah I was using xline but I couldn't find how to limit the line up to y-value 10
John D'Errico
John D'Errico 2020년 11월 30일
편집: John D'Errico 2020년 11월 30일
Then just use plot, or you could use line. Either will force you to supply the line in terms of the endpoints, so they will do what you want better than xline.
Remember that to add a line to a plot, you want to use the command
hold on
to force MATLAB to plot on the previous figure.
Or use stem
stem(10,'Marker','none')
ylim([0,12])
Jens Petit-jean
Jens Petit-jean 2020년 11월 30일
thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

태그

질문:

2020년 11월 30일

댓글:

2020년 11월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by