# HG changeset patch # User jwe # Date 1174684821 0 # Node ID f82f516c8a001932318fb687a047cbc7c0928c1b # Parent 407c08a8e5b745a84814a38316303719bc9a3ae1 [project @ 2007-03-23 21:20:21 by jwe] diff -r 407c08a8e5b7 -r f82f516c8a00 scripts/ChangeLog --- a/scripts/ChangeLog Fri Mar 23 19:20:12 2007 +0000 +++ b/scripts/ChangeLog Fri Mar 23 21:20:21 2007 +0000 @@ -1,5 +1,7 @@ 2007-03-23 John W. Eaton + * sparse/spy.m: Update plotting code. + * plot/__pltopt1__.m: Handle "@" marker same as "+". Handle numeric color specs. * plot/plot.m: Remove "-@" and "@" from docstring. diff -r 407c08a8e5b7 -r f82f516c8a00 scripts/control/base/bode.m --- a/scripts/control/base/bode.m Fri Mar 23 19:20:12 2007 +0000 +++ b/scripts/control/base/bode.m Fri Mar 23 21:20:21 2007 +0000 @@ -141,18 +141,13 @@ ## Get the magnitude and phase of f. mag = abs(f); - phase = arg(f)*180.0/pi; + phase = unwrap (arg(f)*180.0/pi); if (nargout < 1), ## Plot the information save_automatic_replot = automatic_replot; unwind_protect automatic_replot(0); - oneplot(); - __gnuplot_set__ autoscale; - __gnuplot_set__ nokey; - clearplot(); - __gnuplot_set__ data style lines; if(is_digital(sys)) xlstr = ["Digital frequency w=rad/sec. pi/T=",num2str(pi/systsam)]; tistr = "(exp(jwT)) "; @@ -200,8 +195,6 @@ "), u=", inname{1},", y=",outname{1}]); grid("on"); semilogx(w,phase); - ## This should be the default for subsequent plot commands. - oneplot(); endif unwind_protect_cleanup automatic_replot(save_automatic_replot); diff -r 407c08a8e5b7 -r f82f516c8a00 scripts/sparse/spy.m --- a/scripts/sparse/spy.m Fri Mar 23 19:20:12 2007 +0000 +++ b/scripts/sparse/spy.m Fri Mar 23 21:20:21 2007 +0000 @@ -20,32 +20,21 @@ ## Plot the sparsity pattern of the sparse matrix @var{x}. ## @end deftypefn -function spy(S) - if issparse(S) - [i,j,s,m,n]= spfind(S); +function spy (S) + + if (issparse (S)) + [i, j, s, m, n] = spfind (S); else - [i,j,s] = find(S); - [m,n] = size(S); + [i, j, s] = find (S); + [m, n] = size (S); endif - arp = automatic_replot; - unwind_protect - automatic_replot (0); - - eval(sprintf('__gnuplot_set__ nokey')) - eval(sprintf('__gnuplot_set__ yrange [0:%d] reverse',m+1)) - eval(sprintf('__gnuplot_set__ xrange [0:%d] noreverse',n+1)) + if (numel (i) < 1000) + plot (j, i, "*"); + else + plot (j, i, "."); + endif - if (length(i)<1000) - plot(j,i,'*'); - else - plot(j,i,'.'); - endif + axis ([0, n+1, 0, m+1]); - #TODO: we should store the reverse state so we don't undo it - __gnuplot_set__ yrange [0:1] noreverse - axis; - unwind_protect_cleanup - automatic_replot (arp); - end_unwind_protect endfunction