# HG changeset patch # User Ben Abbott # Date 1320182467 14400 # Node ID d67c8bf52e20ce06de5543371353e4453f50a7dc # Parent bebd3ae908cb885a4d00d8d64f5213d56d2e0c07 Minor improvements to semilogx and semilogy demos. diff --git a/scripts/plot/semilogx.m b/scripts/plot/semilogx.m --- a/scripts/plot/semilogx.m +++ b/scripts/plot/semilogx.m @@ -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"); diff --git a/scripts/plot/semilogy.m b/scripts/plot/semilogy.m --- a/scripts/plot/semilogy.m +++ b/scripts/plot/semilogy.m @@ -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");