How can I colour data points based on 3 inputs?
이전 댓글 표시
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')
답변 (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')
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!