When I plot a vertical line the line is a series of dots

조회 수: 3 (최근 30일)
EL
EL 2017년 4월 8일
댓글: EL 2017년 4월 8일
I want to plot a vertical line on a graph. I have tried both with the classic plot function and with the line function.
line(xValue,y)
where xValue is a single number on the x axis and y is a vector defined as y = 1:0.5:400. What I get is in the image.
I have also tried defining the style of the line which for a solid line should be '-' even though it should be solid by default, but nothing changed.

채택된 답변

the cyclist
the cyclist 2017년 4월 8일
I would draw that line like this:
line([xValue xValue],[1 400])
  댓글 수: 1
EL
EL 2017년 4월 8일
It worked, thank you very much.
Can I ask,I believe the command gives a beginning and an end to the line in a more explicit way, but why such a difference? I mean, what was happening in the previous command that matlab didn't get?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by