dolayout (biograph)

Calculate node positions and edge trajectories

Syntax

dolayout(BGobj, 'Propertyname', Propertyvalue...)
dolayout(..., 'OnlyPaths', OnlyPathsValue)

Arguments

BGobj

Biograph object.

OnlyPaths

Property to control the calculation of node position and edge paths. Enter 'true' to calculate only the edge paths.

Description

dolayout(BGobj, 'Propertyname', Propertyvalue...) calls the layout engine to calculate the optimal position for each node so that its 2–D rendering is clean and uncluttered, and then calculates the best curves to represent the edges. The following biograph object properties interact with the layout engine:

dolayout(..., 'OnlyPaths', OnlyPathsValue), when OnlyPaths is 'true', leaves the nodes at their current positions and calculates new curves for the edges.

Example

  1. Create a biograph object.

    cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0];
    bg = biograph(cm)
    bg.nodes(1).Position
     

    Nodes do not have a position yet.

  2. Call the layout engine and render the graph.

    dolayout(bg)
    bg.nodes(1).Position
    view(bg)
    
  3. Manually modify a node position and recalculate the paths.

    bg.nodes(1).Position = [150 150];
    dolayout(bg, 'Onlypaths', true)
    view(bg)
    

See Also

Bioinformatics Toolbox methods for the biograph object, biograph, getancestors, getdescendants, getedgesbynodeid, getnodesbyid, getrelatives, view

MATLAB functions get, set


© 1994-2005 The MathWorks, Inc.