# How to obtain a histogram for 3d data?

12 Ansichten (letzte 30 Tage)
Jessie Bessel am 20 Mär. 2022
Kommentiert: Jessie Bessel am 20 Mär. 2022
Hello!
I'm curious about an extension of the hist3 function in matlab. For a data set in 2D, hist3 is a 3D representation shaped like the data. For example, for matrix A, I get the results:
plot(A(:,1),A(:,2),'linewidth',2); axis tight; grid on;
figure; hist3(A,'Nbins',[30 30],'CDataMode','auto','FaceColor','interp');
But if we consider a 3D data input like B:
plot3(B(:,1),B(:,2),B(:,3),'linewidth',2); axis tight; grid on;
Is there any function that can give a representation shaped like the data based on histogram? Something similar to hist3? To show the histogram and the shape of the data too?
Thank you!
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

Torsten am 20 Mär. 2022
Bearbeitet: Torsten am 20 Mär. 2022
Since your curves are all 1d, a 1d- histogram suffices if you identify x-axis coordinate with curve length or parametrized points in 2d resp. 3d.
A histogram for 3d-data in general is not possible. It would be a representation in 4d - and humans live in 3d.
##### 3 Kommentare1 älteren Kommentar anzeigen1 älteren Kommentar ausblenden
Torsten am 20 Mär. 2022
Yes, that's why I suggested a 1d-histogram. For a presentation, show the curve in 3d where the distribution lives together with the 1d-histogram in which the x-axis represents curve length.
Jessie Bessel am 20 Mär. 2022
Can you help me with a little exemple based on my data, please? I didn't quite understand the processing part.

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Histograms finden Sie in Help Center und File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by