-
Notifications
You must be signed in to change notification settings - Fork 4
/
setPrint.m
30 lines (24 loc) · 822 Bytes
/
setPrint.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
function setPrint(width, height, fname, printType)
% h1 = suptitle(fname(9:end));
% set(h1, 'Interpreter','none','fontsize',4)
if nargin == 3
% printType = 'svg';
printType = 'eps';
end
set(gcf, 'renderer', 'painters', 'renderermode', 'manual');
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperSize',[width height]);
set(gcf,'PaperPosition',[0 0 width height]);
box off;
switch upper(printType)
case 'EPS'
print('-depsc',[fname '.eps'])
case 'PNG'
print('-dpng',[fname '.png'])
case 'PDF'
print('-dpdf',[fname '.pdf'])
case {'TIF', 'TIFF'}
print('-dtiff','-r300',[fname '.tif'])
case {'SVG'}
print('-dsvg',[fname '.svg'])
end