# HG changeset patch # User jwe # Date 1134501614 0 # Node ID 6ada1581e8b409f47d9d0c5a5295d95cd0d20255 # Parent 7e008607a86ee68e1292547945414717c8a459bd [project @ 2005-12-13 19:20:14 by jwe] diff -r 7e008607a86e -r 6ada1581e8b4 scripts/sparse/etreeplot.m --- a/scripts/sparse/etreeplot.m Tue Dec 13 19:05:55 2005 +0000 +++ b/scripts/sparse/etreeplot.m Tue Dec 13 19:20:14 2005 +0000 @@ -16,14 +16,15 @@ ## 02110-1301 USA ## -*- texinfo -*- -## @deftypefn {Function File} {} etreeplot (@var{Tree}) -## @deftypefnx {Function File} {} etreeplot (@var{Tree}, @var{NodeStyle}, @var{EdgeStyle}) -## Plots the elimination tree of the matrix @var{s} or @code{@var{s}+@var{s}'} -## if @var{s} in non-symmetric. The optional parameters @var{LineStyle} and -## @var{EdgeStyle} define the output style. +## @deftypefn {Function File} {} etreeplot (@var{tree}) +## @deftypefnx {Function File} {} etreeplot (@var{tree}, @var{node_style}, @var{edge_style}) +## Plot the elimination tree of the matrix @var{s} or +## @code{@var{s}+@var{s}'} if @var{s} in non-symmetric. The optional +## parameters @var{line_style} and @var{edge_style} define the output +## style. ## @end deftypefn ## @seealso{treeplot,gplot} function etreeplot (s, varargin) - treeplot (etree (s+s'), varargin{:}) + treeplot (etree (s+s'), varargin{:}); endfunction diff -r 7e008607a86e -r 6ada1581e8b4 scripts/sparse/gplot.m --- a/scripts/sparse/gplot.m Tue Dec 13 19:05:55 2005 +0000 +++ b/scripts/sparse/gplot.m Tue Dec 13 19:20:14 2005 +0000 @@ -17,35 +17,36 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} gplot (@var{a}, @var{xy}) -## @deftypefnx {Function File} {} gplot (@var{a}, @var{xy}, @var{LineSpec}) +## @deftypefnx {Function File} {} gplot (@var{a}, @var{xy}, @var{line_style}) ## @deftypefnx {Function File} {[@var{x}, @var{y}] =} gplot (@var{a}, @var{xy}) -## Plots a graph defined by @var{A} and @var{xy} in the graph theory sense. -## @var{A} is the adjacency matrix of the array to be plotted and @var{xy} is a -## @var{n}-by-2 matrix containing the coordinates of the nodes of the graph. +## Plot a graph defined by @var{A} and @var{xy} in the graph theory +## sense. @var{A} is the adjacency matrix of the array to be plotted +## and @var{xy} is an @var{n}-by-2 matrix containing the coordinates of +## the nodes of the graph. ## -## If defined, @var{LineStyle} defines the output style for the plot. Called -## with no output arguments the graph is plotted directly. Called with output -## arguments the coordinates of the plot are returned in @var{x} and @var{y}, -## rather than being plotted. +## The optional parameter @var{line_style} defines the output style for +## the plot. Called with no output arguments the graph is plotted +## directly. Otherwise, return the coordinates of the plot in @var{x} +## and @var{y}. ## @end deftypefn -## @seealso{treeplot,etreeplot,spy} +## @seealso{treeplot, etreeplot, spy} -function [x, y] = gplot (A, xy, LineStyle) +function [x, y] = gplot (A, xy, line_style) if (nargin < 2 || nargin > 3 || nargout > 2) - error ("gplot: wrong number of input/output arguments"); + usage ("gplot (a, xy, line_style)"); endif if (nargin == 2) - LineStyle = "1;;"; + line_style = "1;;"; endif - [i,j] = find(A); + [i, j] = find (A); xcoord = [xy(i,1), xy(j,1), NaN * ones(length(i),1)]'(:); ycoord = [xy(i,2), xy(j,2), NaN * ones(length(i),1)]'(:); if (nargout == 0) - plot(xcoord,ycoord,LineStyle); + plot (xcoord, ycoord, line_style); else x = xcoord; y = ycoord;