Code covered by the BSD License  

Highlights from
Matgraph

from Matgraph by Ed Scheinerman
Toolbox for working with simple, undirected graphs

Description of ldraw
Home > matgraph > @graph > ldraw.m

ldraw

PURPOSE ^

ldraw(g,line_style) --- draw a graph with vertices marked with their labels

SYNOPSIS ^

function ldraw(g,line_style)

DESCRIPTION ^

 ldraw(g,line_style) --- draw a graph with vertices marked with their labels
 If the graph is unlabled, we use the vertex numbers instead.
 See also draw, cdraw, and ndraw.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • draw draw(g) --- draw g in a figure window
  • draw_labels draw_labels(g) --- add labels to a drawing of g
  • is_labeled is_labeled(g) --- determine if there are labels on vertices.
  • ndraw ndraw(g) --- draw g in a figure window with numbered vertices
This function is called by:

SOURCE CODE ^

0001 function ldraw(g,line_style)
0002 % ldraw(g,line_style) --- draw a graph with vertices marked with their labels
0003 % If the graph is unlabled, we use the vertex numbers instead.
0004 % See also draw, cdraw, and ndraw.
0005 
0006 
0007 if ~is_labeled(g)
0008     if nargin ==1
0009         ndraw(g);
0010         return
0011     else
0012         ndraw(g,line_style)
0013         return
0014     end
0015 end
0016 
0017 if nargin == 1
0018     draw(g);
0019 else
0020     draw(g,line_style);
0021 end
0022 
0023 draw_labels(g);

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

Contact us at files@mathworks.com