function MB_FigureSize(Dim1,Dim2,opt)

set(gcf, 'Units', 'centimeters');
set(gcf, 'PaperPositionMode', 'auto');

if opt == 1
    set(gcf,'PaperOrientation','portrait');
%     set(gcf, 'Position',  [5   5   20.9920   13.6157]);
    set(gcf, 'Position',  [5   5   Dim1   Dim2]);
elseif opt==2;
    set(gcf,'PaperOrientation','landscape');
%     set(gcf, 'Position',  [5   2.5   25   16.2159]);    
    set(gcf, 'Position',  [5   2.5  Dim1 Dim2]);
end
set(gca, 'Units','normalized','Position',[0.15 0.2 0.75 0.7]);

