MATLAB: Scatter plot custom colors plotting Assume a=[1 5 7 1 3 9 4 6 8 7]; b=[4 5 6 7 2 6 9 4 2 1]; c=[1 2 0 1 0 2 1 1 0 1]; scatter(a,b) How can I now color the dots using a color code from 0 to 2 corresponding to the values in c? Best Answer 3rd argument is variable size and 4th is variable color.scatter(a,b,[],c,'filled')where 'filled' is optional.If you want another set of colors, just set a different or custom colormap (default is parula) Related SolutionsMATLAB: In matlab, how to make a avi that sequentially fills square. The attached demo may help you. MATLAB: From 2 vectors of n elements To n points C=num2cell([A,B],2); [p1,p2,p3,p4,p5,p6,p7]=deal(C{:}); Related QuestionHelp running Matlab scriptHow to highlight the vertex (vertices) of a voronoi diagramScatter 3D Plot with Varying ColorsCreate a new array from an intersection of two previous arrays
Best Answer