-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepareFigure.m
47 lines (38 loc) · 1.08 KB
/
prepareFigure.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
39
40
41
42
43
44
45
46
47
% This function prepares a figure for print
function prepareFigure(hFig)
% Default Values
if ~nargin
hFig = get(0,'currentFigure');
end
fontName = getFont('Transitional');
for hAxes = findall(hFig,'Type','axes')'
% Set font of all text objects
fontSize = 20;
fontWeight = 'bold';
if ~isempty(fontName)
set(hAxes,'FontName',fontName);
end
set(hAxes,'FontSize',fontSize);
set(hAxes,'FontWeight',fontWeight);
for hText = findall(hFig,'Type','text')'
if ~isempty(fontName)
set(hText,'FontName',fontName);
end
set(hText,'FontSize',fontSize);
set(hText,'FontWeight',fontWeight);
end
% Setup any colorbars
for hCBar = findall(hFig,'Type','colorbar')'
if ~isempty(fontName)
set(hCBar,'FontName',fontName);
end
set(hCBar,'FontSize',fontSize);
set(hCBar,'FontWeight',fontWeight);
end
% Set all line widths
lineWidth = 2;
for hLine = findobj(hAxes,'Type','Line')'
set(hLine,'LineWidth',lineWidth);
end
end
end