function figHandle = graphToPDF(filename,width,height)
    set(gcf, 'PaperPositionMode', 'manual');
    set(gcf, 'PaperUnits', 'inches');
    set(gcf, 'PaperSize', [width height]);
    set(gcf, 'PaperPosition', [0 0 width height]);
%    figHandle = sprintf('-f%d',gcf);
%    print(figHandle, '-r600', '-dpdf', filename);
    print(gcf, '-r600', '-dpdf', filename);
end

