function print(g,fn,varargin) % print(g,fn) % % Prints the GUI object g to file fn.eps exactly as it appears on the screen. % (This is done by setting figure properties 'inverthardcopy' to off, % 'paperpositionmode' to 'auto', and passing the '-loose' option to the % standard print command). % % Other options can be supplied as well; they are passed on to the standard % print command. If other options are present, the '-loose' option % is not automatically passed on to the standard print. For example, % print(g,fn,'-noui') prints the GUI object without the UI controls in a % tight box. set(Fig(g),'inverthardcopy','off','paperpositionmode','auto') if nargin>2, print(Fig(g),'-depsc2',varargin{:},fn) else print(Fig(g),'-depsc2','-loose',fn) end