How do I colour my surface fits a specific colour?
Show older comments
I have 4 surface fits on a figure. How do I colour each of the surfaces a different colour?
Here is my current code:
F1 = fit([MASS_FLOW_CORRECTED(:,1) P_RATIO_TOTAL(:,1)],EFF_TT(:,1),'lowess');
F2 = fit([MASS_FLOW_CORRECTED(:,2) P_RATIO_TOTAL(:,2)],EFF_TT(:,2),'lowess');
F3 = fit([MASS_FLOW_CORRECTED(:,3) P_RATIO_TOTAL(:,3)],EFF_TT(:,3),'lowess');
figure
plot(F1)
hold on
plot(F2)
hold on
plot(F3)
hold on
plot(F4)
hold off
xlabel('Mass Flow (kg/s)')
ylabel('Total Pressure Ratio')
zlabel('Total-Total Efficiency (%)')
title('40mm Plate, Point 3')
Every option I have tried doesn't let me colour a surface fit.
Thanks.
Answers (1)
mizuki
on 18 Sep 2016
Use freezeColors in FileExchange to hold the colormap. For fitted results, use freezeColors after setting the colormap.
load franke
sf1 = fit([x, y],z,'poly23')
h1 = plot(sf1,[x,y],z);
colormap([0.7 0.7 0.7])
h1(1).LineStyle = 'none';
h1(1).FaceAlpha = 0.7;
freezeColors
hold on
sf2 = fit([x, y],z,'poly55');
h2 = plot(sf2,[x,y],z);
colormap([0.1 0.5 0.7])
h2(1).LineStyle = 'none';
h2(1).FaceAlpha = 0.7;
hold off;
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!