[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave
From: |
John B. Thoo |
Subject: |
Re: octave |
Date: |
Fri, 25 Apr 2003 07:20:26 -0700 |
On Friday, April 25, 2003, at 02:29 AM, Joanna Remiszewska wrote:
Hallo!!
I try to investigate in octave two things:
1. how to save plotted image
A.S. Hodel sent the following scripts once that I use regularly.
---John.
---------------------cut here------------------------
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 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
-------------------------------------------------------------
- octave, Joanna Remiszewska, 2003/04/25
- Re: octave, Andreas Helms, 2003/04/25
- Re: octave,
John B. Thoo <=
- Re: octave, Paul Kienzle, 2003/04/25