help-octave
[Top][All Lists]
Advanced

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

Re: Octave scripts and GnuPlot


From: Rob Mahurin
Subject: Re: Octave scripts and GnuPlot
Date: Mon, 23 Mar 2009 07:58:47 -0400

On Mar 23, 2009, at 7:23 AM, Olaf Pohlmann wrote:
If I call this from the interactive shell with source('moebius.m'),
GnuPlot stays open. Apparently the shell forks another process, since
it isn't blocked while GnuPlot is open. Is there a way to get the same
behavior in a script?

octave --persist will give you a command prompt after running your script.
Calling
        gnuplot_binary("gnuplot -persist")
will keep gnuplot's x11 output on screen after gnuplot exits.

And on the other hand: if I only want to create
an image file, is there a way to prevent GnuPlot from being launched?

set(gcf,"visible","off") before plotting.

[...] I don't really understand what triggers the
launch of GnuPlot, I thought is was the call of the axis command.

I think the plot commands go into some queue, which is emptied into gnuplot when an interactive prompt returns. The idea being that piping to gnuplot is expensive, and so a script like

        plot();
        xlabel("this");
        ylabel("that");
        set(gca,"something")

should only call gnuplot once.  If I'm wrong a real expert will pipe up.

Cheers,
Rob

--
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee                 865 207 2594
Knoxville, TN 37996                     address@hidden





reply via email to

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