필터 지우기
필터 지우기

line doesnt appear on my graph

조회 수: 2 (최근 30일)
Austin
Austin 2013년 10월 4일
답변: Image Analyst 2013년 10월 4일
hi,im trying to plot a graph below is my script and outcome of my plot(x,y) graph. can anyone enlighten me on why do i only get scatter points and not a line graph?
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 4일
Please don't post a code as an image, we can not test it
Austin
Austin 2013년 10월 4일
Noted.

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 4일
편집: Azzi Abdelmalek 2013년 10월 4일
x=-10:10
y=log(abs(x-27))./(x.^2+83)
plot(x,y)
% you have missed a . /
  댓글 수: 1
Austin
Austin 2013년 10월 4일
it works,thanks lots!!

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

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 10월 4일
Of course you need a dot like Azzi said. FYI, see this code to see how to adjust the line and markers:
x = 1:10;
y = sin(x);
% b means blue, o means small circle, - means solid line.
plot(x, y, 'bo-', ...
'LineWidth', 4, 'MarkerSize', 20, ...
'MarkerFaceColor', 'r', 'MarkerEdgeColor', [.5, .9, .7]);
You should now be able to get lines between the markers and adjust the way the markers look. Hope this helps. See the help for LineSeries or plot for more options.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by