MATLAB Answers

line doesnt appear on my graph

296 views (last 30 days)
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?


Azzi Abdelmalek
Azzi Abdelmalek on 4 Oct 2013
Please don't post a code as an image, we can not test it

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 4 Oct 2013
Edited: Azzi Abdelmalek on 4 Oct 2013
% you have missed a . /

  1 Comment

Austin on 4 Oct 2013
it works,thanks lots!!

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 4 Oct 2013
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.


Sign in to comment.


Community Treasure Hunt

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

Start Hunting!