changeset 22308:b756cea4fdea

__ezplot__.m: Fix Matlab incompatibilities. * __ezplot__.m: Use space after comma in generated titles. Plot all lines from the same 2-D plot in the same color (ezplot demo 4).
author Rik <rik@octave.org>
date Tue, 16 Aug 2016 08:07:39 -0700
parents 3732bee69510
children 46d39db0c571
files scripts/plot/draw/private/__ezplot__.m
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__ezplot__.m	Tue Aug 16 16:57:42 2016 +0200
+++ b/scripts/plot/draw/private/__ezplot__.m	Tue Aug 16 08:07:39 2016 -0700
@@ -285,7 +285,7 @@
     else
       fstrz = regexprep (regexprep (regexprep (fstrz,
            '\s*\.?(?:\^|\*\*)\s*','^'), '\.([/+-])', '$1'), '\s*\.?\*\s*', ' ');
-      fstr = ["x = " fstrx ",y = " fstry ", z = " fstrz];
+      fstr = ["x = " fstrx ", y = " fstry ", z = " fstrz];
     endif
   else
     fstr = regexprep (regexprep (regexprep (fstr,
@@ -422,9 +422,12 @@
       h = zeros (length (XX), 1);
       hold_state = get (hax, "nextplot");
       for i = 1 : length (XX)
-        h(i) = plot(hax, XX{i}, YY{i});
         if (i == 1)
+          h(1) = plot (hax, XX{1}, YY{1});
           set (hax, "nextplot", "add");
+          color = get (h(1), "color");
+        else
+          h(i) = plot (hax, XX{i}, YY{i}, "color", color);
         endif
       endfor
       set (hax, "nextplot", hold_state);