Home > matgraph > @graph > ndraw.m

ndraw

PURPOSE ^

ndraw(g) --- draw g in a figure window with numbered vertices

SYNOPSIS ^

function ndraw(g,line_style)

DESCRIPTION ^

 ndraw(g) --- draw g in a figure window with numbered vertices
 ndraw(g,line_style) --- lines have given line_style
 see also draw, ldraw, and cdraw

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ndraw(g,line_style)
0002 % ndraw(g) --- draw g in a figure window with numbered vertices
0003 % ndraw(g,line_style) --- lines have given line_style
0004 % see also draw, ldraw, and cdraw
0005 
0006 if nargin == 1
0007     draw(g);
0008 else
0009     draw(g,line_style);
0010 end
0011 
0012 xy = getxy(g);
0013 n = nv(g);
0014 
0015 for v=1:n
0016     x = xy(v,1);
0017     y = xy(v,2);
0018     text(x-.05,y,int2str(v)); 
0019 end

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003