I typed in the following into my MATLAB command window:
>> figure
>> hold on
>> axis([-5, 5, -5, 5])
>> plot(3,4)
However, nothing shows up in my graph. How can I fix this?

댓글 수: 1

plot(3,4)
plots one point with no marker: what do you expect to see?

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

 채택된 답변

Star Strider
Star Strider 2018년 2월 4일

4 개 추천

Try this:
figure
hold on
axis([-5, 5, -5, 5])
plot(3,4,'pg')
The default plot behaviour is to plot a line between successive points. When you give it only one point, it plots nothing unless you tell it to plot a marker, as I do here.

댓글 수: 3

Alec Chirinos
Alec Chirinos 2019년 3월 5일
I know that you where solving a simple question, but you did me a great favor.
Star Strider
Star Strider 2019년 3월 6일
My pleasure.
Rachel Friedman
Rachel Friedman 2021년 2월 8일
two years later but this helped me so much

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

추가 답변 (0개)

카테고리

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

제품

질문:

2018년 2월 4일

댓글:

2021년 2월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by