Probably it's scatter3
what I don't understand. I have a matrix of which all slices but the last are NaNed (M(:,:,1:10) = NaN;
) and then it's permuted switching first and last dimension. So there are only values in M(11,:,:)
. I expect all plotted values to be in the Y-Z plane at x==11
, but the plot looks differently (see code and picture below). Any explanations?
M = rand(22,55,11);
M(:,:,1:10) = NaN;
M = permute(M,[3 2 1]);
shape = size(M)
[x, y, z] = meshgrid(1:shape(1), 1:shape(2), 1:shape(3));
scatter3(x(:), y(:), z(:), 4, M(:), 'fill');
view([60 60]);
xlabel('X ', 'FontSize', 16);
ylabel('Y ', 'FontSize', 16);
zlabel('Z ', 'FontSize', 16);