octave-maintainers
[Top][All Lists]
Advanced

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

Re: [changeset] - improve clf() compatibility


From: David Bateman
Subject: Re: [changeset] - improve clf() compatibility
Date: Wed, 22 Oct 2008 13:15:31 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

David Bateman wrote:
John W. Eaton wrote:
* The refreshdata demo does not seem to be working correctly for me.
  I'm seeing

    octave:1> demo refreshdata
    refreshdata example 1:
     x = 0:0.1:10;
     y = sin (x);
     plot (x, y, "ydatasource", "y");
     for i = 1 : 100
       pause(0.1)
       y = sin (x + 0.1 * i);
       refreshdata();
     endfor

    refreshdata example 1: failed
`y' undefined near line 0 column 1octave:2>


Strange, run from the command line as

x=0:0.1:10;y=sin(x); plot(x,y,"ydatasource","y"); for i = 1:100, pause(0.1); y = sin(x + 0.1*x); refreshdata(); endfor

it works fine.. Not sure yet what is going on here.

D.

Ok, this is in fact obvious.. refreshdata by default evaluates its arguments in the "base" workspace and in a demo script it needs to do it in the "caller" workspace.. Patch attached and pushed to Savannah..

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

# HG changeset patch
# User David Bateman <address@hidden>
# Date 1224677452 -3600
# Node ID b7d2a51e04c4b5e301e7cfa3e95a218acb4d2c11
# Parent  e364f5be1236491c10c3637ac0ed703b122edb8a
Fix for refreshdata demo

diff --git a/scripts/ChangeLog b/scripts/ChangeLog
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,4 +1,7 @@
 2008-10-22  David Bateman  <address@hidden>
+
+       * plot/refreshdata.m: Modify demo so that "y" is evaluated in the
+       "caller" workspace.
 
        * plot/__errplot__.m: Add errorbar series objects.
        * plot/errbar.m: Add some demos.
diff --git a/scripts/plot/refreshdata.m b/scripts/plot/refreshdata.m
--- a/scripts/plot/refreshdata.m
+++ b/scripts/plot/refreshdata.m
@@ -103,5 +103,5 @@
 %! for i = 1 : 100
 %!   pause(0.1)
 %!   y = sin (x + 0.1 * i);
-%!   refreshdata();
+%!   refreshdata(gcf(), "caller");
 %! endfor

reply via email to

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