From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 15 09:04:04 2003 Subject: Re: Newbie Questions From: "John B. Thoo" To: A S Hodel Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 15 Jan 2003 07:03:32 -0800 The functions are very neat. Thanks. (I'm still a newbie, too.) :) Question: Would I have to enter (type in) these functions every time I open octave to use them, or is there a way to "save" these functions so that octave will remember them always? Thanks. ---John. On Wednesday, January 15, 2003, at 06:50 AM, A S Hodel wrote: > > On Wednesday, January 15, 2003, at 06:59 AM, Pablo Barrera wrote: > >> Elijah P Newren wrote: >>> >> >> You must use the gset command. With this command you can pass >> directly to >> gnuplot any "set" command. In order to remove the legend you only need >> >> gset nokey >> >> >> gset is also usefull for printing a image in postcript. >> >> gset terminal postcript >> gset output "output_file.ps" >> plot anything > > here's a few scripts I often use for "printing." printeps is > especially useful if you use LaTeX for document preparation. > > These scripts will not work if you use subplot( ... ) to generate > multiple plots in a single window. You will have to use gset commands > before using gnuplots multiplot capability. > > function printps(filename) > % function printps(filename) > % replot screen plot to a file > % inputs: > % filename: string: > % no argument checking done - this means YOU mark! > > gset terminal postscript color > eval(sprintf("gset output '%s'", filename)); > replot > gset terminal x11 > endfunction > > > function printpng(filename,pngsiz,fn) > % function printpng(filename,pngsiz,fn) > % replot screen plot to a file > % > % inputs: > % filename: string: > % pngsiz: "small", "medium" (default), or "large" > % fn: figure number to convert to png form (default: 0) > % no argument checking done > > if(nargin < 2) > pngsiz = "small"; > elseif(isempty(pngsiz)) > pngsiz = "small"; > endif > if(nargin < 3) > fn =0; > endif > figure(fn); > cmd = (sprintf(" gset terminal png %s color",pngsiz)); > eval(cmd); > cmd = (sprintf("gset output '%s'", filename)); > eval(cmd); > replot > closeplot(); > endfunction > > function printeps(filename) > % function printeps(filename) > % replot screen plot to a file > % inputs: > % filename: string: > % no argument checking done - this means YOU mark! > > gset terminal postscript eps color > eval(sprintf("gset output '%s'", filename)); > replot > #gset terminal x11 > closeplot > endfunction > > > > A. S. Hodel, Assoc. Prof, Dept. Elect & Comp Eng, Auburn University, > AL 36849-5201 > (334) 844-1854 200 Broun Hall hodelas at auburn dot edu > http://www.eng.auburn.edu/~scotte ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------