comparison scripts/plot/semilogx.m @ 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 e81ddf9cacd5
children 5f0bb45e615c
comparison
equal deleted inserted replaced
13782:bebd3ae908cb 13783:d67c8bf52e20
65 %! y = (x .* (1 + rand (size (x)))) .^ 2; 65 %! y = (x .* (1 + rand (size (x)))) .^ 2;
66 %! semilogx (y, x); 66 %! semilogx (y, x);
67 67
68 %!demo 68 %!demo
69 %! clf (); 69 %! clf ();
70 %! a = logspace (-5, 1, 10); 70 %! x = logspace (-5, 1, 10);
71 %! b =-logspace (-5, 1, 10); 71 %! y = logspace (-5, 1, 10);
72 %! 72 %!
73 %! subplot (1, 2, 1) 73 %! subplot (1, 2, 1)
74 %! semilogx (b, a) 74 %! semilogx (x, y)
75 %! xlabel ('semilogx (a, b)') 75 %! xlabel ('semilogx (x, y)')
76 %! 76 %!
77 %! subplot (1, 2, 2) 77 %! subplot (1, 2, 2)
78 %! semilogx (abs (b), a) 78 %! semilogx (-x, y)
79 %! set (gca, 'ydir', 'reverse') 79 %! xlabel ('semilogx (-x, y)')
80 %! xlabel ('semilogx (a, abs (b))') 80
81 %!demo
82 %! clf ();
83 %! x = logspace (-5, 1, 10);
84 %! y = logspace (-5, 1, 10);
85 %!
86 %! subplot (1, 2, 1)
87 %! semilogx (x, y)
88 %! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition")
89 %! xlabel ({"semilogx (x, y)", "xdir = reversed"})
90 %!
91 %! subplot (1, 2, 2)
92 %! semilogx (-x, y)
93 %! set (gca, "xdir", "reverse", "activepositionproperty", "outerposition")
94 %! xlabel ({"semilogx (-x, y)","xdir = reversed"})
81 95
82 %!test 96 %!test
83 %! hf = figure ("visible", "off"); 97 %! hf = figure ("visible", "off");
84 %! unwind_protect 98 %! unwind_protect
85 %! a = logspace (-5, 1, 10); 99 %! a = logspace (-5, 1, 10);