Home > atmlab > graphs > axes_frame.m

axes_frame

PURPOSE ^

AXES_FRAME Visibility of axes frame.

SYNOPSIS ^

function axes_frame(h,on_or_off)

DESCRIPTION ^

 AXES_FRAME   Visibility of axes frame.

    The functions makes the frame for some axes visible or invisible.

    The axes UserData is used to store lost information when making the
    frame invisible. The UserData are used to restore the frame in its
    original version.

 FORMAT   axes_frame(h,on_or_off)
        
 IN    h           Handle to the axes.
       on_or_off   Either 'on' or 'off'.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

axes_frame.m

SOURCE CODE ^

0001 % AXES_FRAME   Visibility of axes frame.
0002 %
0003 %    The functions makes the frame for some axes visible or invisible.
0004 %
0005 %    The axes UserData is used to store lost information when making the
0006 %    frame invisible. The UserData are used to restore the frame in its
0007 %    original version.
0008 %
0009 % FORMAT   axes_frame(h,on_or_off)
0010 %
0011 % IN    h           Handle to the axes.
0012 %       on_or_off   Either 'on' or 'off'.
0013 
0014 % 2002-12-12   Created by Patrick Eriksson.
0015 
0016 
0017 function axes_frame(h,on_or_off)
0018 
0019 
0020 %=== Check input
0021 %
0022 rqre_nargin( 2, nargin );
0023 %
0024 if ~( strcmp( on_or_off, 'off' )  |  strcmp( on_or_off, 'on' ) )
0025   error('Valid actions are ''off'' and ''on''.');
0026 end
0027 
0028 
0029 if strcmp( on_or_off, 'off' )
0030   %
0031   c = get( get( h, 'Parent' ), 'Color' );
0032   %
0033   A.xcol = get( h, 'XCol' );
0034   A.xt   = get( h, 'XTick' );
0035   A.xtl  = get( h, 'XTickL' );
0036   A.ycol = get( h, 'YCol' );
0037   A.yt   = get( h, 'YTick' );
0038   A.ytl  = get( h, 'YTickL' );
0039   A.zcol = get( h, 'ZCol' );
0040   A.zt   = get( h, 'ZTick' );
0041   A.ztl  = get( h, 'ZTickL' );
0042   set( h, 'UserData', A );
0043   %
0044   set( h, 'Box', 'off' );
0045   set( h, 'XCol', c );
0046   set( h, 'XTick', [] );
0047   set( h, 'XTickL', [] );
0048   set( h, 'YCol', c );
0049   set( h, 'YTick', [] );
0050   set( h, 'YTickL', [] );
0051   set( h, 'ZCol', c );
0052   set( h, 'ZTick', [] );
0053   set( h, 'ZTickL', [] );
0054 
0055 else
0056   %
0057   A = get( h, 'UserData' );
0058   %
0059   set( h, 'Box', 'on' );
0060   set( h, 'XCol', A.xcol );
0061   set( h, 'XTick', A.xt );
0062   set( h, 'XTickL', A.xtl );
0063   set( h, 'YCol', A.ycol );
0064   set( h, 'YTick', A.yt );
0065   set( h, 'YTickL', A.ytl );
0066   set( h, 'ZCol', A.zcol );
0067   set( h, 'ZTick', A.zt );
0068   set( h, 'ZTickL', A.ztl );
0069 
0070 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005