help-octave
[Top][All Lists]
Advanced

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

Re: plot saving


From: John B. Thoo
Subject: Re: plot saving
Date: Fri, 25 Mar 2005 21:39:04 -0800

I use the following file: "/sw/share/octave/site/m/printfig.m".

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Edited printeps.m by
%
% A. S. Hodel
% Assoc. Prof, Dept. Elect & Comp Eng
% Auburn University, AL 36849-5201
% address@hidden
%
% to print to fig (xfig)
% JBT 2003/05/09


function printfig(filename)
% function printfig(filename)
% replot screen plot to a file
% inputs:
%   filename: string:
% no argument checking done - this means YOU mark!

  gset terminal fig color
  eval(sprintf("gset output '%s'", filename));
  replot
  #gset terminal x11
  closeplot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

To print a plot to a file, I simply type

  > printfig ("filename.fig")

It works great.  And you can easily edit it to "printeps", &c.

---John.


On Mar 25, 2005, at 8:55 PM, address@hidden wrote:

I see that you got plenty of answers for your first question and
none for the second.
In order to save a plot, like in gnuplot you replot it to some
"other terminal".
The sequence of commands (in octave is):
gset term postscript % look up gnuplot manual or help for the various optins of this term
gset output "whatever you like"
replot
% And then don't forget to return to your default
gset term X11

In my experience, for some reason, the next plot tends to replace
your previously saved plot with an empty file. So, it's safer to
move it away to some other directory, before anything else.
Using the term fig (see again its options in the gnuplot
manual/help), you get the option to annotate/edit your graph with
xfig, which can export it to a variety of formats.
I saw in previous correspondence that there are functions in
octave forge which do the same thing as the series of steps I
just described, apparently better. I did not try them. You know:
"If ain't broken, do not mend it!". But you may find them more
comfotable. Search the mail archive.
Cheers, Avraham



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