Skip to content
Ido Rosen edited this page Jan 3, 2014 · 3 revisions

Here are some of the various layouts possible with graphViz4Matlab.

Setting the Layout

{{{GraphViz4Matlab}}} currently supports 8 different layouts, affecting the automated placement of the nodes. These can be changed by selecting the appropriate button in the display window, or programmatically, either at creation time or after the fact.

When creating a graphViz4Matlab object, you can specify a layout, (here a tree layout) as follows: adj = rand(5) > 0.5; % random 5x5 adjacency matrix graphViz4Matlab('-adjMat', adj, '-layout', Treelayout)

By default, a 'minimum energy' layout is used, (the default graphViz layout).

To programmatically change the layout after creation, use the setLayout method as follows:

adj = rand(5) > 0.5; % random 5x5 adjacency matrix
g = graphViz4Matlab(adj)
g.setLayout(Radiallayout)


Of the following, all require graphViz except the last 3: Circlelayout, Gridlayout, Randlayout.

Gvizlayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/minenergy.jpg


Treelayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/tree.jpg


Radiallayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/radial.jpg


Circularlayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/circular.jpg


Springlayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/spring.jpg


Circlelayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/simpleCircle.jpg


Gridlayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/grid.jpg


Randlayout

https://raw.github.com/graphviz4matlab/graphviz4matlab/master/docs/images/random.jpg