I'm trying to plot a cubic 3D scene-grid stored in a 3D matrix data
which contains indices (eg [0..10]) which indicate in which color the voxel is plotted, where 0 is the "empty" label. In Matlab I use the following code:
[X,Y,Z] = meshgrid(1:size(data,1),1:size(data,2),1:size(data,3));
xyz=[X(:) Y(:) Z(:)];
idx = data~=0; % Ignore labels 0 -> they specify empty voxels
pcshow(xyz(idx,:),data(idx),'MarkerSize',1000)
Are there similar functions in python?
This stackoverflow-answer is close but it lacks the possibility to pass the data
matrix. A hack would be to loop over all labels, but I'm looking for a more elegant solution.