-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmakeImpRes.m
61 lines (54 loc) · 1.62 KB
/
makeImpRes.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function dum=makeImpRes(simseries,tvec,titles,colors,format,lbl,printfile, for_slides, width_ratio)
% Adding font size option
if nargin < 9
width_ratio = 1.0;
if nargin < 8
for_slides = 0;
end
end
dum=[];
sims=size(simseries);
if length(sims)==2
npp=1;
npl=sims(2);
nper=sims(1);
simseries=reshape(simseries,[1,size(simseries)]);
else
npp=sims(1);
npl=sims(3);
nper=sims(2);
end
if npl~=prod(format)
disp('format does not match number of plots');
return;
end
fig = figure;
for p=1:npl
h=subplot(format(1),format(2),p);
hold on;
for pp=1:npp
plot(tvec,squeeze(simseries(pp,:,p)),colors{pp},'LineWidth',1.5);
end
if for_slides
set(gca, 'FontSize', 16);
else
set(gca, 'FontSize', 14);
end
title(h,titles{p});
set(h,'XLim',[min(tvec),max(tvec)],'XTick',min(tvec):round((tvec(end)-tvec(1))/5):max(tvec),'XGrid','on','GridLineStyle','-');
end
if ~isempty(lbl)
l=legend(lbl{:},'Location','best');
l.FontSize=14;
end
set(gcf,'PaperUnits','inches');
set(gcf,'PaperSize',[width_ratio*4*format(2) 4*format(1)]);
set(gcf,'PaperPosition',[0 0 width_ratio*4*format(2) 4*format(1)]);
set(gcf,'PaperPositionMode','manual');
%set(gcf,'PaperSize',[10*format(1), 3*format(2)]);
if ~isempty(printfile)
print('-dpdf','-r0',[printfile,'.pdf']);
print('-depsc',[printfile,'.eps']);
end
%close(fig);
end