blob: 5ad3e777edba4ba71ba70b6e3c9621c6ee571e3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<h1>Visualizing graph structures in matlab</h1>
We discuss some methods for visualizing graphs/ networks, including automatic
layout of the nodes.
We assume the graph is represented as an adjacency matrix.
If using BNT, you can access the DAG using
<pre>
G = bnet.dag;
</pre>
<h2>Matlab's biograph function</h2>
The Mathworks computational biology toolbox
has many useful graph related functions, including visualization.
<br>
Click
<a href="http://www.mathworks.com/products/bioinfo/demos.html?file=/products/demos/shipping/bioinfo/graphtheorydemo.html#4">
here</a>
for a demo.
<h2>Cemgil's draw_graph</h2>
You can visualize an arbitrary graph (such as one learned using the
structure learning routines) with Matlab code written by
<a href="http://www-sigproc.eng.cam.ac.uk/~atc27/matlab/layout.html">
Ali Taylan Cemgil</a>
from the University of Cambridge.
A modified version of this code
is <a href="GraphViz.zip">here</a>
(this is already bundled with BNT).
Just type
<pre>
draw_graph(G);
</pre>
For example, this is the output produced on a
<a href="http://www.cs.ubc.ca/~murphyk/Software/BNT/usage.html#qmr">random QMR-like model</a>:
<p>
<img src="Figures/qmr.rnd.jpg">
<p>
<h2>Pajek</h2>
<a href="http://vlado.fmf.uni-lj.si/pub/networks/pajek">Pajek</a>
is an excellent, free Windows program for graph layout.
Use <a href="adj2pajek2.m">adj2pajek2.m</a> to convert a graph to the
Pajek file format.
<br>
Then Choose File->Network->Read from the menu.
<h2>AT&T Graphviz</h2>
<a href="http://www.research.att.com/sw/tools/graphviz">graphhviz</a>
is an
open-source graph visualization package from AT&T.
Use
<a href="graph_to_dot.m">graph_to_dot</a>
to convert an adjacency matrix to
the AT&T file format (the "dot" format).
You then use dot to convert it to postscript:
<pre>
graph_to_dot(G, 'filename', 'foo.dot');
dot -Tps foo.dot -o foo.ps
ghostview foo.ps &
</pre>
|