更好的 MATLAB Plot3 可视化缺少什么?

What is missing for a better MATLAB Plot3 visualization?

我使用 MATLAB plot3 函数生成了下图。

这个数字不好。 因为,我认为,读者很难从这个图中估计坐标。 点的高度(Z 值)太难从图中估计。 我的图中缺少什么使其难以解释?


玩转数据: 可视化数据为here. The function to produce my current figure is here. Either comment the mArrow3 call, or download it from here.

我认为问题可能是这类图的固有问题:你的数据的 0d 点很难从透视角度解释,你的大脑无法破译 深度数据点位于。例如,在我看来,您在 z=0 和 x=15 以上没有数据点,这显然是错误的,但我的大脑将您的大部分点归因于 z=-5 平面。

除非您的数据点的体积有限且随距离成比例地变化(这不能用 matlab 完成,而且可能无论如何也无济于事),否则您可能需要重新考虑您的可视化方式。有 3 个地块如何,每个地块沿 x、y 和 z 轴都有相机?

编辑让我觉得在回答问题时我应该有更开放的心态:)

为了更好地查看高度,您可以在零高度处使用 stem3 to draw a vertical line from the floor to each point. You can enhance the representation with a semi-transparent patch 突出显示地板

% // Random data
x = -20+50*rand(1,50);
y = 150*rand(1,50);
z = -5+10*rand(1,50);

%// With plot
figure
plot3(x,y,z,'.','markersize',8)
grid on
axis equal
view(-33, 14)

%// With stem3 and patch
figure
stem3(x,y,z,'.','markersize',8)
grid on
hold on
patch([-20 30 30 -20], [0 0 150 150], [0 0 0 0], 'k', ...
    'edgecolor', [.5 .5 .5], 'FaceAlpha' , .1)
axis equal
view(-33, 14)

您还可以使用不同的 colors/markers/point 大小来区分数据中的不同区域。例如 z 小于 0 的值为红色,大于 0 的为绿色。这是一个使用 scatter3 和 4 个不同区域的简单示例。感谢 Luis Mendo 提供的虚拟数据。

clc;clear;close all


% // Random data...thanks Luis Mendo
x = -20+50*rand(1,50);
y = 150*rand(1,50);
z = -5+10*rand(1,50);

%// Get indices for various regions in your data
region1 = find(z>=-4 & z<-2);
region2 = find(z>=-2 & z<0);
region3 = find(z>=0 & z<2);
region4 = find(z>=2 & z<4);

%// Draw each region with its own color/size
scatter3(x(region1),y(region1),z(region1),20,'r','filled')
hold on
scatter3(x(region2),y(region2),z(region2),40,'y','*')
scatter3(x(region3),y(region3),z(region3),60,'g','filled')
scatter3(x(region4),y(region4),z(region4),80,'b')

grid on

view(-33, 14)

kkuilla's answer关于热图产生了更好的结果: