scatter3 plot to a mesh plot or surface plot

13 次查看(过去 30 天)
I have (x,y,z) coordinate points and corresponding intensity values (c) at each of those points. I currently have a scatter plot for this, but I want to turn it into a mesh plot or surface plot to better visualize the trends and keep the colorbar for the intensity values. Any help would be greatly appreciated! This is what I have right now:
x = [0 -9 9 0 -9 9 0 -9 9 0 -9 9 0 -9 9];
y = [17 17 17 10 10 10 10 10 10 10 10 10 17 17 17];
z = [11 11 11 11 11 11 7 7 7 15 15 15 15 15 15];
c = [33 33 33 21 24 13 11 24 15 13 24 11 25 22 32];
markerSize = 50;
scatter3(x,y,z,markerSize,c,'filled')
colorbar

回答(1 个)

Carlos Guerrero García
编辑:Carlos Guerrero García 2022-11-30
I don't know what kind of surface do you want to add...perhaps something like this???
x = [0 -9 9 0 -9 9 0 -9 9 0 -9 9 0 -9 9];
y = [17 17 17 10 10 10 10 10 10 10 10 10 17 17 17];
z = [11 11 11 11 11 11 7 7 7 15 15 15 15 15 15];
c = [33 33 33 21 24 13 11 24 15 13 24 11 25 22 32];
markerSize = 50;
scatter3(x,y,z,markerSize,c,'filled');
colorbar;
hold on;
surf([-9 9],[10 10],[7 7;15 15],'FaceAlpha',0.15)
  3 个评论
Carlos Guerrero García
编辑:Carlos Guerrero García 2022-11-30
Something like this ??
x = [0 -9 9 0 -9 9 0 -9 9 0 -9 9 0 -9 9];
y = [17 17 17 10 10 10 10 10 10 10 10 10 17 17 17];
z = [11 11 11 11 11 11 7 7 7 15 15 15 15 15 15];
c = [33 33 33 21 24 13 11 24 15 13 24 11 25 22 32];
colorplanes=parula; % parula is the name of the default colormap
markerSize = 50;
for k=0:0.2:17;
scatter3(x,y,z,markerSize,c,'filled');
colorbar;
hold on;
surf([-9 9],[10+7*k/17 10+7*k/17],[7 7;15 15],'FaceAlpha',0.15,'FaceColor',colorplanes(1+floor(k*63/17),:));
drawnow;
hold off;
end
SHREYA
SHREYA 2022-12-1
Its not quite what I'm looking for but thanks!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by