line doesnt appear on my graph
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Austin
el 4 de Oct. de 2013
Respondida: Image Analyst
el 4 de Oct. de 2013
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150347/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150349/image.jpeg)
2 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 4 de Oct. de 2013
Editada: Azzi Abdelmalek
el 4 de Oct. de 2013
x=-10:10
y=log(abs(x-27))./(x.^2+83)
plot(x,y)
% you have missed a . /
Más respuestas (1)
Image Analyst
el 4 de Oct. de 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.
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!