changeset 4340:8aa604426d35

[project @ 2003-02-20 04:01:31 by jwe]
author jwe
date Thu, 20 Feb 2003 04:01:31 +0000
parents 05ba2a8757da
children de9b588bf002
files scripts/ChangeLog scripts/plot/axis.m scripts/signal/freqz_plot.m
diffstat 3 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu Feb 20 01:40:58 2003 +0000
+++ b/scripts/ChangeLog	Thu Feb 20 04:01:31 2003 +0000
@@ -1,3 +1,7 @@
+2003-02-19  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* plot/axis.m: Avoid whitespace in literal matrix problem.
+
 2003-02-18  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* linear-algebra/logm.m: New file.
--- a/scripts/plot/axis.m	Thu Feb 20 01:40:58 2003 +0000
+++ b/scripts/plot/axis.m	Thu Feb 20 04:01:31 2003 +0000
@@ -134,6 +134,7 @@
 
   elseif (isstr (ax))
     ax = tolower (ax);
+    len = length (ax);
 
     ## 'matrix mode' to reverse the y-axis
     if (strcmp (ax, "ij"))
@@ -154,9 +155,9 @@
 
 
       ## axis limits
-    elseif (length (ax) >= 4 && strcmp (ax (1:4), "auto"))
-      if length (ax) > 4
-      	eval (["gset autoscale ", ax (5 : length (ax)), ";"]);
+    elseif (len >= 4 && strcmp (ax(1:4), "auto"))
+      if (len > 4)
+      	eval (sprintf ("gset autoscale %s;", ax(5:len)));
       else
 	gset autoscale;
       endif
@@ -191,18 +192,18 @@
       gset xtics;
       gset ytics;
       gset ztics;
-    elseif (length (ax) > 3 && strcmp (ax (1:3), "tic"))
-      if any (ax == "x")
+    elseif (len > 3 && strcmp (ax(1:3), "tic"))
+      if (any (ax == "x"))
 	gset xtics;
       else
 	gset noxtics;
       endif
-      if any (ax == "y")
+      if (any (ax == "y"))
 	gset ytics;
       else
 	gset noytics;
       endif
-      if any (ax == "z")
+      if (any (ax == "z"))
 	gset ztics;
       else
 	gset noztics;
@@ -211,18 +212,18 @@
       gset format;
     elseif (strcmp (ax, "nolabel"))
       gset format "\\0";
-    elseif (length (ax) > 5 && strcmp (ax (1:5), "label"))
-      if any (ax == "x")
+    elseif (len > 5 && strcmp (ax(1:5), "label"))
+      if (any (ax == "x"))
 	gset format x;
       else
 	gset format x "\\0";
       endif
-      if any (ax == "y")
+      if (any (ax == "y"))
 	gset format y;
       else
 	gset format y "\\0";
       endif
-      if any (ax == "z")
+      if (any (ax == "z"))
 	gset format z;
       else
 	gset format z "\\0";
@@ -243,15 +244,15 @@
     __current_axis__ = reshape (ax, 1, len);
 
     if (len > 1)
-      eval (sprintf ("gset xrange [%g:%g];", ax (1), ax (2)));
+      eval (sprintf ("gset xrange [%g:%g];", ax(1), ax(2)));
     endif
 
     if (len > 3)
-      eval (sprintf ("gset yrange [%g:%g];", ax (3), ax (4)));
+      eval (sprintf ("gset yrange [%g:%g];", ax(3), ax(4)));
     endif
 
     if (len > 5)
-      eval (sprintf ("gset zrange [%g:%g];", ax (5), ax (6)));
+      eval (sprintf ("gset zrange [%g:%g];", ax(5), ax(6)));
     endif
 
   else
--- a/scripts/signal/freqz_plot.m	Thu Feb 20 01:40:58 2003 +0000
+++ b/scripts/signal/freqz_plot.m	Thu Feb 20 04:01:31 2003 +0000
@@ -79,7 +79,7 @@
       axis ("autoy");
       xlabel ("Frequency");
       axis ([ w(1), w(n) ]);
-      plot (w, phase/(2*pi), ";Phase (radians/2pi);");
+      plot (w, phase*360/(2*pi), ";Phase (degrees);");
       
     unwind_protect_cleanup