Projection of 3D positions histograms in planes XY, YZ, and XZ
9 ビュー (過去 30 日間)
古いコメントを表示
I have N points whose 3D coordinates are given. I want to plot 2D histograms for the x- and y-coordinates on XY plane at Z=0 of a 3D box. Next, on the adjacent walls of this box, I have to plot 2D histograms for y- and z-coordinates on YZ plane at X=0 and 2D histogram for x- and z-coordinates on XZ plane at Y=0.
2 件のコメント
採用された回答
darova
2020 年 6 月 30 日
Here is an example
m = 20;
% generate some data
n = 500;
x = randn(500,1);
y = randn(500,1);
z = randn(500,1);
% create regular grid
x1 = linspace(min(x),max(x),m);
y1 = linspace(min(y),max(y),m);
[X,Y] = meshgrid(x1,y1);
% calculate density matrix
xy = hist3([x y],[m m]);
plot3(x,y,z,'.r')
surface(X,Y,xy*0-5,'cdata',xy)
axis vis3d
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!