Changing CData values for a surf plot.

45 次查看(过去 30 天)
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 个评论
Ali Shakeri
Ali Shakeri 2020-11-1
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

请先登录,再进行评论。

回答(1 个)

Divija Aleti
Divija Aleti 2021-2-5

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by