-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFigureLayout.m
40 lines (30 loc) · 1.11 KB
/
FigureLayout.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
function FigureLayout(varargin)
% FigureLayout(layout, varargin)
% layout = [proportion of screen x , proportion of screen y]
% varargin: scaling (default is 4)
layout = [0.5 0.5];
scaling = 4;
varargin = process_varargin(varargin);
mainFontSize = 6 * scaling;
varargin = process_varargin(varargin);
labelFontSize = mainFontSize * 10/8;
titleFontSize = mainFontSize;
legendFontSize = mainFontSize;
process_varargin(varargin);
set(gcf, 'units', 'normalized', 'position', [0 0, layout]);
a = findobj(gcf, 'Type', 'axes');
for iA = 1:length(a)
axes(a(iA));
set(gca, 'FontName', 'Arial', 'FontSize', mainFontSize);
set(get(gca, 'xlabel'), 'FontName', 'Arial', 'FontSize', labelFontSize);
set(get(gca, 'ylabel'), 'FontName', 'Arial', 'FontSize', labelFontSize);
set(get(gca, 'title'), 'FontName', 'Arial', 'FontSize', titleFontSize);
t = findobj(gca, 'Type', 'text');
if ~isempty(t)
set(t, 'FontName', 'Arial', 'FontSize', mainFontSize);
end
L = get(gca, 'legend');
if ~isempty(L)
set(L, 'fontname', 'Arial', 'FontSize', legendFontSize, 'box', 'off');
end
end