MATLAB: How to add line style after color colorplot style If I give the colors using [0 0.4470 0.7410] , then how to give the line circle or square shapes ?? I know that plot(x,y,'r+') is used to give the color and style. Best Answer Try this: figurehl = plot((0:9), rand(1,10));hl.Color = [0 0.4470 0.7410]; % Define Line Colorhl.LineStyle = '-'; % Define Line Stylehl.Marker = 's'; % Define ‘square’ Markerhl.MarkerFaceColor = 'g'; % Define ‘square’ Marker ColorUse the structure syntax to change the line and marker parameters after the line is plotted. Related SolutionsMATLAB: There is no color property on the Scatter class. https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.scatter-properties.htmlMarkerFaceColor or MarkerEdgeColor or CDataor use scatter(x, y, pointsize, color) positionally MATLAB: Color individual data points One way is to just stamp a new marker right on top of the existing one:plot(strain,Ystress,'LineWidth',2, "MarkerSize",5, "MarkerFaceColor",[0 0.4470 0.7410], "MarkerEdgeColor",[0 0.4470 0.7410] );hold on;plot(strain(4),Ystress(4), 'r.', "MarkerSize", 25); % Big red dot.plot(strain(10),Ystress(10), 'g.', "MarkerSize", 25); % Big green dot.hold off; Related QuestionHow to customize 2D plot lines with shapesHow to hide or delete the legend that is not neededColor of line plot with marker problemAdd markers to stem plot above a threshold
Best Answer