How can I colour data points based on 3 inputs?
Show older comments
I have 780 data points that are gathered from simulations, and each one has three control point parameters. For example, data point 1 has control points set to [0.5, 0.1, 1], point 35 has [0.52, 0.1, 1.4].
How can I colour the data points in the plot so each points has a colour that corresponds to a unique combination of the three control point parameters? I believe I should be able to link each data point to an RGB code but I am unsure how to do that. The list of control points is shown below (it extends to 780), and the plot code is also below.

figure(1);
plot(FR5(:,2),FR5(:,1), '-x','LineStyle','none', 'DisplayName', 'Mach 3.0')
title('Multi-Objective Optimisation for Nose Cone with Fineness Ratio 2.5 at Mach 3.0')
xlabel('Drag Coefficient')
ylabel('Volumetric Efficiency')
Answers (1)
Since you don't seem to want a connecting line in your data points (LineStyle='none'), a scatter plot would probably be more appropriate, and does let you assign colors to individual markers.
scatter(FR5(:,2),FR5(:,1),36,RGB,'x')
Categories
Find more on Color and Styling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!