Home > utils > scale_fig_axes.m

scale_fig_axes

PURPOSE ^

scale_fig_axes(fignum,scale_factor)

SYNOPSIS ^

function scale_fig_axes(fignum,scale_factor)

DESCRIPTION ^

 scale_fig_axes(fignum,scale_factor)

 Multiplies all axes positions in the figure by the scale factor

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function scale_fig_axes(fignum,scale_factor)
0002 % scale_fig_axes(fignum,scale_factor)
0003 %
0004 % Multiplies all axes positions in the figure by the scale factor
0005 
0006 % 02/01/07 Petr Janata
0007 
0008 kids = get(fignum,'children');
0009 nkids = length(kids);
0010 
0011 for ikid = 1:nkids
0012   if strcmp(get(kids(ikid),'type'),'axes')
0013     old_pos = get(kids(ikid),'position');
0014     new_pos = old_pos*scale_factor;  % scale
0015     % Adjust offsets within page
0016     new_pos([1 2]) = new_pos([1 2])+(old_pos([1 2])-new_pos([1 2]))/2;
0017     set(kids(ikid),'position',new_pos)
0018   end
0019 end % for ikid=

Generated on Sun 24-Mar-2019 04:00:51 by m2html © 2003