www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/ControlNumberOfDecimalPlacesForzAxisTickLabelsExample.m

    %% Control Number of Decimal Places for _z_-Axis Tick Labels
% Create a 3-D scatter plot of random data. Display the _z_-axis tick
% labels with two decimal places. Control the decimal places by passing
% |ztickformat| a character vector of a numeric format that uses
% fixed-point notation for the conversion character and a precision value
% of 2.

x = rand(50,1);
y = rand(50,1);
z = rand(50,1);
scatter3(x,y,z)
ztickformat('%.2f')