changeset 13783:d67c8bf52e20

Minor improvements to semilogx and semilogy demos.
author Ben Abbott <bpabbott@mac.com>
date Tue, 01 Nov 2011 17:21:07 -0400
parents bebd3ae908cb
children 0bbe319bf26b
files scripts/plot/semilogx.m scripts/plot/semilogy.m
diffstat 2 files changed, 44 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/semilogx.m	Tue Nov 01 16:50:38 2011 -0400
+++ b/scripts/plot/semilogx.m	Tue Nov 01 17:21:07 2011 -0400
@@ -67,17 +67,31 @@
 
 %!demo
 %! clf ();
-%! a = logspace (-5, 1, 10);
-%! b =-logspace (-5, 1, 10);
+%! x = logspace (-5, 1, 10);
+%! y = logspace (-5, 1, 10);
 %!
 %! subplot (1, 2, 1)
-%! semilogx (b, a)
-%! xlabel ('semilogx (a, b)')
+%! semilogx (x, y)
+%! xlabel ('semilogx (x, y)')
 %!
 %! subplot (1, 2, 2)
-%! semilogx (abs (b), a)
-%! set (gca, 'ydir', 'reverse')
-%! xlabel ('semilogx (a, abs (b))')
+%! semilogx (-x, y)
+%! xlabel ('semilogx (-x, y)')
+
+%!demo
+%! clf ();
+%! x = logspace (-5, 1, 10);
+%! y = logspace (-5, 1, 10);
+%!
+%! subplot (1, 2, 1)
+%! semilogx (x, y)
+%! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition")
+%! xlabel ({"semilogx (x, y)", "xdir = reversed"})
+%!
+%! subplot (1, 2, 2)
+%! semilogx (-x, y)
+%! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition")
+%! xlabel ({"semilogx (-x, y)","xdir = reversed"})
 
 %!test
 %! hf = figure ("visible", "off");
--- a/scripts/plot/semilogy.m	Tue Nov 01 16:50:38 2011 -0400
+++ b/scripts/plot/semilogy.m	Tue Nov 01 17:21:07 2011 -0400
@@ -68,17 +68,31 @@
 
 %!demo
 %! clf ();
-%! a = logspace (-5, 1, 10);
-%! b =-logspace (-5, 1, 10);
+%! x = logspace (-5, 1, 10);
+%! y = logspace (-5, 1, 10);
+%!
+%! subplot (2, 1, 1)
+%! semilogy (x, y)
+%! ylabel ('semilogy (x, y)')
 %!
-%! subplot (1, 2, 1)
-%! semilogy (a, b)
-%! xlabel ('semilogy (a, b)')
+%! subplot (2, 1, 2)
+%! semilogy (x, -y)
+%! ylabel ('semilogy (x, -y)')
+
+%!demo
+%! clf ();
+%! x = logspace (-5, 1, 10);
+%! y = logspace (-5, 1, 10);
 %!
-%! subplot (1, 2, 2)
-%! semilogy (a, abs (b))
-%! set (gca, 'ydir', 'reverse')
-%! xlabel ('semilogy (a, abs (b))')
+%! subplot (2, 1, 1)
+%! semilogy (x, y)
+%! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition")
+%! ylabel ({"semilogy (x, y)", "ydir = reversed"})
+%!
+%! subplot (2, 1, 2)
+%! semilogy (x, -y)
+%! set (gca, "ydir", "reverse", "activepositionproperty", "outerposition")
+%! ylabel ({"semilogy (x, -y)", "ydir = reversed"})
 
 %!test
 %! hf = figure ("visible", "off");