Changing CData values for a surf plot.

56 views (last 30 days)
Ali Shakeri
Ali Shakeri on 1 Nov 2020
Answered: Divija Aleti on 5 Feb 2021
I want to symply change a surface plots Cdata with a callback.
cyl = surf(X_Length,Y_Circle,Z_Circle,'Cdata',map100);
Im trying thia cyl.Cdata = map200; but it wont work.
what can i do?
  4 Comments
Ali Shakeri
Ali Shakeri on 1 Nov 2020
let me post the whole code :
map100 = getCylinderHeatMap(filename);
[X_Length,Y_Circle,Z_Circle,map100] = createSurfCylinderInitial(map100);
cyl = surf(X_Length,Y_Circle,Z_Circle,'Cdata',map100);
splitFileName = strsplit(string(T{1,1}),'.');
title(compose("3D Cylinder Heatmap Plot" + "\n" + "Time: " + splitFileName{1,1}));
zlabel("Z-Position");
ylabel("Y-Position");
xlabel("X-Length(Cm)");
set(gca,'Ydir','reverse')
colormap(myHeatMap);
colorbar;
shading interp
Maximum_Value = 450;
Minimum_Value = 50;
caxis([Minimum_Value Maximum_Value]);
callback
function []= sliderCallback(b,T,myHeatMap,cyl)
value = round(b.Value);
%Testing lines load your matrix%
filename = strcat('\Users\Ali\Desktop\Documents\DataVis\Projekt\data\day\', string(T{value,1}));
map100 = getCylinderHeatMap(filename);
splitFileName = strsplit(string(T{value,1}),'.');
map100 = createSurfCylinderMapOnly(map100);
cyl.Cdata = map100;
title(compose("3D Cylinder Heatmap Plot" + "\n" + "Time: " + splitFileName{1,1}));
zlabel("Z-Position");
ylabel("Y-Position");
xlabel("X-Length(Cm)");
set(gca,'Ydir','reverse');
colormap(myHeatMap);
colorbar;
shading interp
%
Maximum_Value = 450;
Minimum_Value = 50;
caxis([Minimum_Value Maximum_Value]);
end

Sign in to comment.

Answers (1)

Divija Aleti
Divija Aleti on 5 Feb 2021

Categories

Find more on Data Distribution Plots 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!