Code covered by the BSD License  

Highlights from
Matgraph

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

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

scale

PURPOSE ^

scale(g,s) --- rescale the embedding of g by s

SYNOPSIS ^

function scale(g,s)

DESCRIPTION ^

 scale(g,s) --- rescale the embedding of g by s

CROSS-REFERENCE INFORMATION ^

This function calls:
  • embed embed --- create an embedding for a graph
  • getxy getxy(g) --- give g's embedding (or [] if g doesn't have one)
  • hasxy hasxy(g) --- determine if an embedding has been created for g
This function is called by:
  • graffle graffle(g, filename, width, rad) --- write graph in OmniGraffle format

SOURCE CODE ^

0001 function scale(g,s)
0002 % scale(g,s) --- rescale the embedding of g by s
0003 
0004 if ~hasxy(g)
0005     embed(g)
0006 end
0007 
0008 xy = getxy(g);
0009 xy = s*xy;
0010 embed(g,xy);

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

Contact us at files@mathworks.com