octave-maintainers
[Top][All Lists]
Advanced

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

Re: [changeset] property value not paired with name in __add_datasource_


From: David Bateman
Subject: Re: [changeset] property value not paired with name in __add_datasource__.m
Date: Mon, 01 Sep 2008 12:28:47 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080725)

Ben Abbott wrote:

On Aug 31, 2008, at 12:52 PM, Ben Abbott wrote:


On Aug 31, 2008, at 11:15 AM, John W. Eaton wrote:

On 31-Aug-2008, Michael Goffioul wrote:

| The following patch (in graphics mq) solves the problem
| http://hg.tw-math.de/octave-graphics-mq/file/9d2c6e36870f/set_empty_args

I applied it.

Thanks,

jwe

I started fresh, but the default branch still fails to build ... new error though :-)

../../run-octave -f -q -H -p . --eval "geometryimages ('voronoi', 'eps');"
error: set: invalid number of arguments
error: called from:
error: /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt2vv__.m at line 83, column 7 error: /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt2__.m at line 68, column 14 error: /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt__.m at line 79, column 10 error: /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/plot.m at line 189, column 5 error: /Users/bpabbott/Development/mercurial/octave-3-0-0/doc/interpreter/geometryimages.m at line 45, column 5

make[3]: *** [voronoi.eps] Error 1
make[2]: *** [interpreter] Error 2
make[1]: *** [doc] Error 2
make: *** [all] Error 2

I identified the problem is in __plt2vv__.m

[...]
69     hg = hggroup ();
70     retval = hg;
71 properties = __add_datasource__ ("__plt2vv__", hg, {"x", "y", "z"},
72                                      properties{:});
73
74     h = line (x, y, "keylabel", key, "color", color,
75               "linestyle", options.linestyle,
76               "marker", options.marker, "parent", hg);
77
78     __add_line_series__ (h, hg);
79     if (! isempty (properties))
80       set (hg, properties{:});
81     endif

Prior to line 71"properties" is set as

{
 [1,1] = LineWidth
 [1,2] =  3
}

Subsequently, "properties is set as

{
 [1,1] = LineWidth
}

... there is no value paired with the property name. I'm not familiar with the intended behavior, but have attempted a fix. Changeset is attached. With this in place, I now get warnings but haven't looked deeper.

geometryimages ('voronoi', 'eps')
warning: legend: plot data is empty; setting key labels has no effect
warning: legend: ignoring extra labels

Ben

<__add_datasource__.txt>

I found another instance of "set" being used with empty properties, combined patch attached.

Ben

Working back from my previous patch that introduced this issue and taking into account the fixes already made by Michael, here is the changeset that gets all of these

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 1220264482 -7200
# Node ID 79ace969785cac0e104146191869c69089178130
# Parent  b583e3969a772bde88f0bc9366cdef38836d4799
Additional do not call set with empty arguments fixes

diff --git a/scripts/plot/__area__.m b/scripts/plot/__area__.m
--- a/scripts/plot/__area__.m
+++ b/scripts/plot/__area__.m
@@ -63,7 +63,9 @@ function retval = __area__ (ax, x, y, bv
     addproperty ("areagroup", hg, "data");
     set (retval, "areagroup", retval);
 
-    set (hg, args{:});
+    if (! isempty (args))
+      set (hg, args{:});
+    endif
   endfor
 
 endfunction
diff --git a/scripts/plot/__bars__.m b/scripts/plot/__bars__.m
--- a/scripts/plot/__bars__.m
+++ b/scripts/plot/__bars__.m
@@ -113,7 +113,9 @@ function tmp = __bars__ (ax, vertical, x
 
     addproperty ("bargroup", hg, "data");
     set (tmp, "bargroup", tmp);
-    set (hg, args{:});
+    if (! isempty (args))
+      set (hg, args{:});
+    endif
     if (i == 1)
       set (h_baseline, "parent", get (hg, "parent"));
     endif
diff --git a/scripts/plot/__quiver__.m b/scripts/plot/__quiver__.m
--- a/scripts/plot/__quiver__.m
+++ b/scripts/plot/__quiver__.m
@@ -295,7 +295,9 @@ function hg = __quiver__ (varargin)
     addlistener (hg, "markerfacecolor", @update_props); 
     addlistener (hg, "markersize", @update_props);
 
-    set (hg, args{:});
+    if (! isempty (args))
+      set (hg, args{:});
+    endif
   unwind_protect_cleanup
     set (h, "nextplot", hstate);
   end_unwind_protect
diff --git a/scripts/plot/__stem__.m b/scripts/plot/__stem__.m
--- a/scripts/plot/__stem__.m
+++ b/scripts/plot/__stem__.m
@@ -143,7 +143,9 @@ function h = __stem__ (have_z, varargin)
       addlistener (hg, "ydata", @update_data);
       addlistener (hg, "zdata", @update_data);
 
-      set (hg, args{:});
+      if (! isempty (args))
+       set (hg, args{:});
+      endif
       if (i == 1 && !isempty(h_baseline))
        set (h_baseline, "parent", get (hg, "parent"));
       endif
diff --git a/scripts/plot/plot3.m b/scripts/plot/plot3.m
--- a/scripts/plot/plot3.m
+++ b/scripts/plot/plot3.m
@@ -315,6 +315,9 @@ function retval = plot3 (varargin)
 
     __add_line_series__ (hline, hg);
 
+    if (! isempty (properties))
+      set (hg, properties{:});
+    endif
   endif
 
   set (gca (), "view", [-37.5, 30]);
diff --git a/scripts/plot/stairs.m b/scripts/plot/stairs.m
--- a/scripts/plot/stairs.m
+++ b/scripts/plot/stairs.m
@@ -175,7 +175,9 @@ function [h, xs, ys] = __stairs__ (doplo
        addlistener (hg, "markeredgecolor", @update_props); 
        addlistener (hg, "markersize", @update_props); 
 
-       set (hg, args{:});
+       if (! isempty (args))
+         set (hg, args{:});
+       endif
       endfor
     unwind_protect_cleanup
       set (gca (), "nextplot", hold_state);

reply via email to

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