function printgif(filename,gifsiz,fn) % function printgif(filename,gifsiz,fn) % replot screen plot to a file % % Note: for reasons I don't understand, you need to tell % octave to close gnuplot or some of your gifs will be empty. % printgif does this automatically. % % inputs: % filename: string: % gifsiz: x,y size of gif. Default: gifsiz=[640, 480] % fn: figure number to convert to gif form (default: 0) % no argument checking done # A S Hodel Feb 2000 address@hidden if(nargin < 2) gifsiz = [640 480]; elseif(isempty(gifsiz)) gifsiz = [640 480]; endif if(nargin < 3) fn =0; endif figure(fn); cmd = (sprintf(" gset terminal gif size %d,%d",gifsiz(1), gifsiz(2))); eval(cmd); cmd = (sprintf("gset output '%s'", filename)); eval(cmd); replot closeplot gset terminal x11 endfunction