Not sure about the PCA, but here is an example showing how to visualize 3D scalar volume data, and volume reduction on an inclined plane (without axis aligned). The code is inspired by this demo in the MATLAB documentation.
% volume data [x,y,z,v] = flow(); vv = double(v < -3.2); % threshold to get volume with 0/1 values vv = smooth3(vv); % smooth data to get nicer visualization :) xmn = min(x(:)); xmx = max(x(:)); ymn = min(y(:)); ymx = max(y(:)); zmn = min(z(:)); zmx = max(z(:)); % let create a slicing plane at an angle=45 about x-axis, % get its coordinates, then immediately delete it n = 50; h = surface(linspace(xmn,xmx,n), linspace(ymn,ymx,n), zeros(n)); rotate(h, [-1 0 0], -45) xd = get(h, 'XData'); yd = get(h, 'YData'); zd = get(h, 'ZData'); delete(h) % prepare figure clf set(gcf, 'Renderer','zbuffer') % render isosurface at level=0.5 as a wire-frame isoval = 0.5; [pf,pv] = isosurface(x, y, z, vv, isoval); p = patch('Faces',pf, 'Vertices',pv, ... 'FaceColor','none', 'EdgeColor',[0.5 1 0.5]); isonormals(x, y, z, vv, p) % draw a slice through the volume at the rotated plane we created hold on h = slice(x, y, z, vv, xd, yd, zd); set(h, 'FaceColor','interp', 'EdgeColor','none') % draw slices at axis planes h = slice(x, y, z, vv, xmx, [], []); set(h, 'FaceColor','interp', 'EdgeColor','none') h = slice(x, y, z, vv, [], ymx, []); set(h, 'FaceColor','interp', 'EdgeColor','none') h = slice(x, y, z, vv, [], [], zmn); set(h, 'FaceColor','interp', 'EdgeColor','none') % customize view and color-mapping daspect([1,1,1]) axis tight vis3d; view(-45,35); camlight; lighting gouraud camproj perspective colormap(flipud(jet(16))); caxis([0 1]); colorbar xlabel x; ylabel y; zlabel z box on
Below is a result showing an isosurface made in the form of a wire frame, in addition to the cut planes oriented along the axes, and one rotated. We see that the volume space inside the isosurface has values ββequal to 1, and 0 on the outside
