forked from ggventurini/python-deltasigma
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchangeFig.m
executable file
·38 lines (37 loc) · 1.11 KB
/
changeFig.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function changeFig(fontsize,linewidth,markersize)
% changeFig(fontsize,linewidth,markersize) Change the settings
% for all objects in the current figure window
% Handle the input arguments
parameters = {'fontsize' 'linewidth' 'markersize'};
defaults = { 9 1 6 };
for i=1:length(defaults)
parameter = char(parameters(i));
if i>nargin | ( eval(['isnumeric(' parameter ') ']) & ...
eval(['any(isnan(' parameter ')) | isempty(' parameter ') ']) )
eval([parameter '=defaults{i};'])
end
end
children = get(gcf,'children');
children = children(:)';
for child=children
type = get(child,'type');
if type=='axes'
set(child,'fontsize',fontsize)
axisChildren = get(child,{'children' 'xlabel' 'ylabel' 'title'});
axisChildren = [axisChildren{1}' axisChildren{2:4}];
for axisChild=axisChildren
type = get(axisChild,'type');
switch type
case 'line'
set(axisChild,'linewidth',linewidth);
set(axisChild,'markersize',markersize);
case 'text'
set(axisChild,'fontsize',fontsize);
otherwise
;
end
end
else
fprintf(1,'type is %s (not ''axes'')\n',type);
end
end