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: David Bateman
Subject: Re: plotting while preserving some properties
Date: Thu, 04 Sep 2008 12:12:11 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080725)

Giovanni Di Stasi 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?

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?

Many thanks.

I'm using:
GNU Octave, version 3.0.0
Gnuplot Version 4.2 patchlevel 2


In the repository this can be done with something like

          x = 0:0.1:10;
          y = sin (x);
          plot (x, y, "ydatasource", "y");
          xlabel ("x");
          ylabel("y");
          title ("This is a moving plot");
          for i = 1 : 100
            pause(0.1)
            y = sin (x + 0.1 * i);
            refreshdata();
          endfor

though not in 3.0.x. For 3.0.x you can try something like

          x = 0:0.1:10;
          y = sin (x);
          h = plot (x, y);
          xlabel ("x");
          ylabel("y");
          title ("This is a moving plot");
          for i = 1 : 100
            drawnow ();
            pause(0.1)
            y = sin (x + 0.1 * i);
            set (h, "ydata", y);
          endfor

D.




--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary



reply via email to

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