octave-maintainers
[Top][All Lists]
Advanced

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

Re: Revised rlocus m-file


From: John W. Eaton
Subject: Re: Revised rlocus m-file
Date: Wed, 14 Mar 2007 12:12:29 -0400

On 13-Mar-2007, Daniel J Sebald wrote:

| However, I'm getting back a
| handle pointer which doesn't seem quite right.  In rlocus.m I placed
| the following: 
| 
|     hplt = plot (args{:});
|     get(hplt)
| 
| and I get 
| 
| ans = [...]
| 
| But this is the handle to the *zeros* only.  Should "plot", even
| with this argument format, return a handle to the whole plot?  In
| other words, if one goes to the __plt2vv__.m
| 
|     retval = line (x, y, "keylabel", key, "color", color,
|                  "linestyle", options.linestyle,
|                  "marker", options.marker);
| 
| which, I think, ends up being the retval, but that isn't the handle
| for the whole plot, is it?

If there are multiple lines created, the plot function should return a
vector of handles for all the lines.  Try the following patch.

| Also, I notice in the rlocus.m plot that the zeros are actually
| filled dots, not open circles.  It turns out now that the
| "pentagram" gets mapped to the open circle.  Currently in plot
| options "o" in the filled circle.  Shouldn't "o" be the open circle,
| not "pentagram"? 

Yes.

jwe


scripts/ChangeLog:

2007-03-14  John W. Eaton  <address@hidden>

        * plot/__plt__.m: Return line handles from all calls to __plt1__
        and __plt2__, not just the last.


Index: scripts/plot/__plt__.m
===================================================================
RCS file: /cvs/octave/scripts/plot/__plt__.m,v
retrieving revision 1.48
diff -u -u -r1.48 __plt__.m
--- scripts/plot/__plt__.m      13 Feb 2007 08:08:33 -0000      1.48
+++ scripts/plot/__plt__.m      14 Mar 2007 16:08:26 -0000
@@ -36,6 +36,8 @@
 
     ## Gather arguments, decode format, gather plot strings, and plot lines.
 
+    retval = [];
+
     while (nargs > 0 || x_set)
 
       if (nargs == 0)
@@ -51,9 +53,11 @@
        if (x_set)
          options = __pltopt__ (caller, next_arg);
          if (y_set)
-           retval = __plt2__ (h, x, y, options);
+           tmp = __plt2__ (h, x, y, options);
+           retval = [retval; tmp];
          else
-           retval = __plt1__ (h, x, options);
+           tmp = __plt1__ (h, x, options);
+           retval = [retval; tmp];
          endif
          x_set = false;
          y_set = false;
@@ -63,7 +67,8 @@
       elseif (x_set)
        if (y_set)
          options = __pltopt__ (caller, {""});
-         retval = __plt2__ (h, x, y, options);
+         tmp = __plt2__ (h, x, y, options);
+         retval = [retval; tmp];
          x = next_arg;
          y_set = false;
        else

reply via email to

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