MATLAB: How to plot line with dots MATLAB I have a two matrix X and Y. I want to make a line graph with dots with plot function. plot (x,y,'–ok'); it is just plotting black circles but ı want to plot line too with circles. Best Answer There are several options: x = 1:10;y = rand(1,10);subplot(3,1,1)plot(x, y, '-ok')title('Circles and Lines')subplot(3,1,2)plot(x, y, 'ok', 'MarkerFaceColor','k')title('Filled Circles')subplot(3,1,3)plot(x, y, '.k')title('Dots')One of those (or a combination of them) should do what you want. . Related SolutionsMATLAB: Scatter function to set different color for particular point. One possible way:ids={'AKHR','AKSR','CIHA'};x=[38.36927164;38.37038981;39.0791021];y=[31.42974208;33.99814907;33.06536336]; figure(1),scatter(x(1:2), y(1:2), 'b^', 'LineWidth',4) hold on scatter(x(3),y(3),'^r', 'LineWidth',4) hold off grid on;text(x, y, ids); xlabel('Longtitude','fontsize',16); ylabel('Latitude','fontsize',16); MATLAB: How to plot dots There are a couple ways. Here's a simple one:figureplot(1:10,'.-');"doc plot" will give you info on the different choices for marker and line styles.Slightly more complicated, but worth learning, is how to manipulate the properties of the line after you have plotted it. Here is an example:figureh = plot(1:10);set(h,'Marker','square')You can achieve control over nearly ever aspect of your plots when you know how to use "handle graphics", which is the term for these manipulations.Here is a longer document that goes into great detail about how to use handle graphics: http://www.mathworks.com/support/tech-notes/1200/1205.html Related QuestionPlot points without connect itCombining two plots and adding color to pointsHow to use scatter with transparent dotsHow to have different marker sizes for different points in 1 line plotHow to edit properties of a plot and highlight certain points in the graph at the same timeHow to make a 2D graph withs dots
Best Answer