From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 15 10:16: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 08:15:57 -0800 Thank you. I use Mac OS X, too, so I will follow your directions exactly. ---John. On Wednesday, January 15, 2003, at 08:04 AM, A S Hodel wrote: > Store them as "m-files" just like in Matlab. I would have sent three > attachments (printps.m, printpng.m, printeps.m), but that's sometimes > a problem for people on a mailing list. > > Details: the functions must be in your octave "path," e.g., your > current directory or ${OCTAVEHOME}/share/octave/site/m > where ${OCTAVEHOME} is the directory where octave is installed. [Does > that apply under Windows/Cygwin? I only use Mac OS X, so our windows > counterparts may need to help with this detail.] > > On Wednesday, January 15, 2003, at 09:03 AM, John B. Thoo wrote: > >> 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 >> >> > 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 -------------------------------------------------------------