It is my understanding you want to colorcode the points on your graph according to a colormap. To create a visualization similar to the image attached in the question, you can use the "scatter" function in MATLAB to assign color indices using a colormap.
You may refer to the following MATLAB code snippet:
c = 1:4; % Specify color using a colormap index
scatter(1:4, [2 5 3 7], [], c)
colormap(gca, "winter")
Alternatively, you can specify the color using RGB triplets as a vector corresponding to the data you wish to visualize:
% Specify color using RGB triplet
c = [0 1 0; 1 0 0; 0.5 0.5 0.5; 0.6 0 1];
scatter(1:4,[2 5 3 7],[],c)
For more information on the "scatter" function, kindly refer to the following MathWorks documentation:
I hope this helps!