1. 1. n1 = n'; --> why does the histogram have to be transposed?
Because dat is defined as
but the grid is defined with xb from the first column (that is -y) and yb from the second column of dat, which is x:
xb = linspace(min(dat(:,1)),max(dat(:,1)),size(n,1)+1);
yb = linspace(min(dat(:,2)),max(dat(:,2)),size(n,1)+1);
To get the right mapping for the x and y axis in the plot
the n1 has to be transposed before.
2. h.ZData = ones(size(n1)) * -max(max(n)); --> what does this line do?
This moves the pcolor plot down by max(max(n) to appear below the hist3 plot.
Best Answer