help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Questions


From: A S Hodel
Subject: Re: Newbie Questions
Date: Wed, 15 Jan 2003 08:50:32 -0600


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 address@hidden 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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]