How to flip a scatter3 plot?
5 次查看(过去 30 天)
显示 更早的评论
Hi, I'm unsuccessfully trying to flip a scatter3 plot so that the XY plane is on top and Z axis goes downward. Below a rough drawing of what I get vs what I want

setting ZDir property to "reverse" doesn't do the job as the Z axis flips direction, but the X and Y axis remain on the bottom
0 个评论
回答(1 个)
Star Strider
2025-3-3
I am not quite certain what you want.
Perhaps this —
xyz = rand(50,3)
figure
scatter3(xyz(:,1),xyz(:,2),xyz(:,3),25,xyz(:,3), 'filled')
grid on
xlabel('X')
ylabel('Y')
zlabel('Z')
colormap(turbo)
colorbar
figure
scatter3(xyz(:,1),xyz(:,2),xyz(:,3),25,xyz(:,3), 'filled')
grid on
xlabel('X')
ylabel('Y')
zlabel('Z')
colormap(turbo)
colorbar
Ax = gca;
Ax.CameraUpVector = [0 0 -1];
.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!