Home > atmlab > graphs > set_titles.m

set_titles

PURPOSE ^

SET_TITLES Properties of plot titles.

SYNOPSIS ^

function set_titles(h,varargin)

DESCRIPTION ^

 SET_TITLES   Properties of plot titles.

    The function sets any property of plot title objects. The properties are 
    applied to the given handles and their childrens (all generations, 
    see *children*). To set the fontsize for all titles of a figure to 10
       set_titles( gcf, 'FontSize', 10 );

    See also *set_axes* and *set_labels*.

 FORMAT   set_titles(h,varargin)

 IN    h   Handle to a figure, or figure objects.
           Arbitrary number of property / property value pairs.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

set_titles.m

SOURCE CODE ^

0001 % SET_TITLES   Properties of plot titles.
0002 %
0003 %    The function sets any property of plot title objects. The properties are
0004 %    applied to the given handles and their childrens (all generations,
0005 %    see *children*). To set the fontsize for all titles of a figure to 10
0006 %       set_titles( gcf, 'FontSize', 10 );
0007 %
0008 %    See also *set_axes* and *set_labels*.
0009 %
0010 % FORMAT   set_titles(h,varargin)
0011 %
0012 % IN    h   Handle to a figure, or figure objects.
0013 %           Arbitrary number of property / property value pairs.
0014 
0015 % 2002-12-13   Created by Patrick Eriksson.
0016 
0017 
0018 function set_titles(h,varargin)
0019 
0020 
0021 %=== Check input
0022 %
0023 rqre_nargin( 1, nargin );
0024 %
0025 if ~isvector( h )
0026   error('The argument *h* must be a numeric vector.');
0027 end
0028 %
0029 if ~iseven( length(varargin) )
0030   error('Input be pairs of property and its value.');
0031 end
0032 
0033 
0034 %=== Append given handle(s) and children
0035 %
0036 h = [ h; children( h ) ];
0037 
0038 
0039 %=== Loop handles and scale all possible text
0040 %
0041 for ih = 1 : length( h )
0042 
0043   if strcmp( get( h(ih), 'type' ), 'axes' )
0044 
0045     hl = get( h(ih), 'Title');
0046     set( hl, varargin{:} );
0047 
0048   end
0049 
0050 end

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