wolffd@0:
Visualizing graph structures in matlab
wolffd@0:
wolffd@0: We discuss some methods for visualizing graphs/ networks, including automatic
wolffd@0: layout of the nodes.
wolffd@0: We assume the graph is represented as an adjacency matrix.
wolffd@0: If using BNT, you can access the DAG using
wolffd@0:
wolffd@0: G = bnet.dag;
wolffd@0:
wolffd@0:
wolffd@0: Matlab's biograph function
wolffd@0:
wolffd@0: The Mathworks computational biology toolbox
wolffd@0: has many useful graph related functions, including visualization.
wolffd@0:
wolffd@0: Click
wolffd@0:
wolffd@0: here
wolffd@0: for a demo.
wolffd@0:
wolffd@0:
wolffd@0:
wolffd@0: Cemgil's draw_graph
wolffd@0:
wolffd@0: You can visualize an arbitrary graph (such as one learned using the
wolffd@0: structure learning routines) with Matlab code written by
wolffd@0:
wolffd@0: Ali Taylan Cemgil
wolffd@0: from the University of Cambridge.
wolffd@0: A modified version of this code
wolffd@0: is here
wolffd@0: (this is already bundled with BNT).
wolffd@0: Just type
wolffd@0:
wolffd@0: draw_graph(G);
wolffd@0:
wolffd@0: For example, this is the output produced on a
wolffd@0: random QMR-like model:
wolffd@0:
wolffd@0:
wolffd@0:
wolffd@0:
wolffd@0:
Pajek
wolffd@0:
wolffd@0: Pajek
wolffd@0: is an excellent, free Windows program for graph layout.
wolffd@0: Use adj2pajek2.m to convert a graph to the
wolffd@0: Pajek file format.
wolffd@0:
wolffd@0: Then Choose File->Network->Read from the menu.
wolffd@0:
wolffd@0: AT&T Graphviz
wolffd@0:
wolffd@0: graphhviz
wolffd@0: is an
wolffd@0: open-source graph visualization package from AT&T.
wolffd@0: Use
wolffd@0: graph_to_dot
wolffd@0: to convert an adjacency matrix to
wolffd@0: the AT&T file format (the "dot" format).
wolffd@0: You then use dot to convert it to postscript:
wolffd@0:
wolffd@0: graph_to_dot(G, 'filename', 'foo.dot');
wolffd@0: dot -Tps foo.dot -o foo.ps
wolffd@0: ghostview foo.ps &
wolffd@0: