help-octave
[Top][All Lists]
Advanced

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

Re: plot to file


From: James R. Phillips
Subject: Re: plot to file
Date: Wed, 7 Dec 2005 04:28:05 -0800 (PST)

--- Shai Ayal  wrote:

> 
> in this case case, if you want no-X than you should probably use gnuplot 
> directly, maybe using the approach that john uses -- use octave to do the 
> calculations ans output the results to a file, and then use gnuplot to 
> produce graphs from the files. gnuplot can produce files in a variety of 
> formats without any X necessary
> 

If you don't mind using __gnuplot_set__, there is a relatively simple way to
plot without X. Try something like this:

=========
__gnuplot_set__ term push;
__gnuplot_set__ term postscript eps color;
__gnuplot_set__ output "/dev/null";

[commands to make your plot, exclusive of printing]

__gnuplot_set_output "output_file.eps";
replot;
pause(1);
__gnuplot_set__ term pop;
__gnuplot_set__ output;

========
The pause seems to be required at times to prevent garbling the output file.

This approach is very similar to what the print command actually does, if you
study the code.  It will not work if multiplot mode is invoked in the set of
plot commands (neither does print).

jrp




-------------------------------------------------------------
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]