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

    %% Change Style of Box Outline
% First, plot a surface and display the box outline around the axes. By
% default, the outline appears around the back planes of the axes because
% the |BoxStyle| property of the axes is set to |'back'|.

% Copyright 2015 The MathWorks, Inc.


[X,Y,Z] = peaks;
surf(X,Y,Z)
box on

%% 
% Next, display the outline around the entire axes by setting the
% |BoxStyle| property to |'full'|. Starting in R2014b, you can use dot
% notation to set properties. If you are using an earlier release, use the
% <docid:matlab_ref.f67-432995> function instead.

ax = gca;
ax.BoxStyle = 'full';