help-octave
[Top][All Lists]
Advanced

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

Re: plotting while preserving some properties


From: Michael Goffioul
Subject: Re: plotting while preserving some properties
Date: Thu, 4 Sep 2008 12:36:39 +0200

On Thu, Sep 4, 2008 at 11:50 AM, Giovanni Di Stasi
<address@hidden> wrote:
> Hi,
>
> I am using Octave and Gnuplot in order to draw a "moving" graph; I'm doing
> that by calling repeatedly plot(X) and replot() with the new matrix; Between
> a plot and the next, I'd like the title, the ylabel and the xlabel to be
> preserved (without having to call title(...), xlabel(...) and ylabel(...)
> every time). How can I do that?

h = plot (...);
xlabel (...);
ylabel (...);
hold on;
drawnow ();
while (...)
  delete (h);
  h = plot (...);
  drawnow ();
endwhile

> Another question: I call my script from bash (I made it executable and put
> #! /usr/bin/octave -qf at the beginning) and, as I said above, I have to call
> both plot and replot (If I just call plot, the figure won't even show up),
> whilst, in the Octave command line, plot is sufficient. Shouldn't plot be
> enough in both cases?

No, because octave actually sends data to gnuplot on the next drawnow
call. This is called automatically before printing the octave prompt. When you
use octave in bash script, the prompt is never used, so you have to call
drawnow manually.

Michael.


reply via email to

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