3D plot, draw (X,Y,Z,value)
4 次查看(过去 30 天)
显示 更早的评论
how to performe a plot like contours (X,Y,Z,Value)
I have a set of data
for example
(1,1,1)=5
(1,1,2)=7
(1,2,1)=6
i want to plot it like a 3D with legend
Sample for the data
X Y Z Value
1 1 0.000 1.000
1 1 0.005 2.000
1 1 0.010 3.000
1 1 0.015 4.000
1 1 0.020 5.000
1 1 0.025 6.000
1 2 0.000 7.000
1 2 0.005 8.000
1 2 0.010 9.000
1 2 0.015 10.000
1 2 0.020 11.000
1 2 0.025 12.000
i 3 0.000 13.000
1 3 0.005 14.000
1 3 0.010 15.000
1 3 0.015 16.000
1 3 0.020 17.000
1 3 0.025 18.000
2 1 0.000 19.000
2 1 0.005 20.000
2 1 0.010 21.000
2 1 0.015 22.000
2 1 0.020 23.000
2 1 0.025 24.000
2 2 0.000 25.000
2 2 0.005 26.000
2 2 0.010 27.000
2 2 0.015 28.000
2 2 0.020 29.000
2 2 0.025 30.000
2 3 0.000 31.000
2 3 0.005 32.000
2 3 0.010 33.000
2 3 0.015 34.000
2 3 0.020 35.000
2 3 0.025 36.000
2 个评论
Star Strider
2022-8-27
This does not make sense to me.
I’m posting this in the event someone else may have some insight into it —
xyzv = [ 1 1 0.000 1.000
1 1 0.005 2.000
1 1 0.010 3.000
1 1 0.015 4.000
1 1 0.020 5.000
1 1 0.025 6.000
1 2 0.000 7.000
1 2 0.005 8.000
1 2 0.010 9.000
1 2 0.015 10.000
1 2 0.020 11.000
1 2 0.025 12.000
1 3 0.000 13.000
1 3 0.005 14.000
1 3 0.010 15.000
1 3 0.015 16.000
1 3 0.020 17.000
1 3 0.025 18.000
2 1 0.000 19.000
2 1 0.005 20.000
2 1 0.010 21.000
2 1 0.015 22.000
2 1 0.020 23.000
2 1 0.025 24.000
2 2 0.000 25.000
2 2 0.005 26.000
2 2 0.010 27.000
2 2 0.015 28.000
2 2 0.020 29.000
2 2 0.025 30.000
2 3 0.000 31.000
2 3 0.005 32.000
2 3 0.010 33.000
2 3 0.015 34.000
2 3 0.020 35.000
2 3 0.025 36.000 ];
Xm = reshape(xyzv(:,1),6,[])
Ym = reshape(xyzv(:,2),6,[])
Zm = reshape(xyzv(:,3),6,[])
Vm = reshape(xyzv(:,4),6,[])
figure
surf(Xm,Ym,Zm)
colormap(turbo(5))
.
dpb
2022-8-27
Perhaps @John D'Errico's <HighDimensionalPlottingIssues> will be of some conceptual benefit to the poster...
回答(1 个)
Chunru
2022-8-28
编辑:Chunru
2022-8-28
You can use scatter3 with marker size/color to represent value, though it is not a contour.
xyzv = [ 1 1 0.000 1.000
1 1 0.005 2.000
1 1 0.010 3.000
1 1 0.015 4.000
1 1 0.020 5.000
1 1 0.025 6.000
1 2 0.000 7.000
1 2 0.005 8.000
1 2 0.010 9.000
1 2 0.015 10.000
1 2 0.020 11.000
1 2 0.025 12.000
1 3 0.000 13.000
1 3 0.005 14.000
1 3 0.010 15.000
1 3 0.015 16.000
1 3 0.020 17.000
1 3 0.025 18.000
2 1 0.000 19.000
2 1 0.005 20.000
2 1 0.010 21.000
2 1 0.015 22.000
2 1 0.020 23.000
2 1 0.025 24.000
2 2 0.000 25.000
2 2 0.005 26.000
2 2 0.010 27.000
2 2 0.015 28.000
2 2 0.020 29.000
2 2 0.025 30.000
2 3 0.000 31.000
2 3 0.005 32.000
2 3 0.010 33.000
2 3 0.015 34.000
2 3 0.020 35.000
2 3 0.025 36.000 ];
% Use scatter3
scatter3(xyzv(:,1), xyzv(:,2), xyzv(:,3), xyzv(:,4), xyzv(:,4))
colorbar
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!