MATLAB: How to add histgram in a ‘slice’ figure

histogramslice figure

figure;clf
[X Y Z V] = flow;
x1 = min(min(min(X)));x2 = max(max(max(X)));
y1 = min(min(min(Y)));y2 = max(max(max(Y)));
z1 = min(min(min(Z)));z2 = max(max(max(Z)));
sx = linspace(x1+1.2,x2,5);
sy = 0;
sz = 0;
slice(X,Y,Z,V,sx,sy,sz);
view([-33,36])
shading interp;
'flow' is a array defined on the three dimensional space, 'slice' function can realize four-dimensional performance. However, not only I need a section, but also I urgent need a histgram. I want to know how to realize it?

Best Answer

hold on
hist(Z(:)); %example histogram