outImgName='_my3D_HiDpiColor.png'; [X,Y,Z] = peaks(50) ; % Create some dummy data. parallaxAngle = 0.5 ; % You can change this to suit yourself. cameraAnchor = [ max(X(:)) max(Y(:)) min(Z(:)) ] ; leftImage = subplot(1,2,1) surf(X,Y,Z) % Create the surface figure. axis vis3d ; % Lock the aspect ration for rotation. camtarget(gca,[cameraAnchor]) % Point the camera at the anchor point. view((-45 - parallaxAngle),30) ; % Rotate the figre to the correct angle. title ('Plot Title', 'FontWeight','Bold','FontSize',11) % Add labels... xlabel ('X Axis Label', 'FontWeight','Bold','FontSize',11) ylabel ('Y Axis Label', 'FontWeight','Bold','FontSize',11) zlabel ('Z Axis Label', 'FontWeight','Bold','FontSize',11) grid on ; % Switch on the figure grid, and set(gca,'GridLineStyle','-') % set the grid to solid lines. rightImage = subplot(1,2,2) surf(X,Y,Z) % Create the surface figure. axis vis3d ; % Lock the aspect ration for rotation. camtarget(gca,[cameraAnchor]) % Point the camera at the anchor point. view((-45 + parallaxAngle),30) ; % Rotate the figre to the correct angle. title ('Plot Title', 'FontWeight','Bold','FontSize',11) % Add labels... xlabel ('X Axis Label', 'FontWeight','Bold','FontSize',11) ylabel ('Y Axis Label', 'FontWeight','Bold','FontSize',11) zlabel ('Z Axis Label', 'FontWeight','Bold','FontSize',11) grid on ; % Switch on the figure grid, and set(gca,'GridLineStyle','-') % set the grid to solid lines. print(gcf,outImgName,'-dpng','-r600');