scatter3 plot to a mesh plot or surface plot
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Carlos Guerrero García
el 30 de Nov. de 2022
Editada: Carlos Guerrero García
el 30 de Nov. de 2022
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 comentarios
Carlos Guerrero García
el 30 de Nov. de 2022
Editada: Carlos Guerrero García
el 30 de Nov. de 2022
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
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!