Skip to content

Instantly share code, notes, and snippets.

@quantombone
Created January 27, 2012 20:47
Show Gist options
  • Save quantombone/1690842 to your computer and use it in GitHub Desktop.
Save quantombone/1690842 to your computer and use it in GitHub Desktop.
an example of matlab graphviz wrappers to display graphs
%Create an empty directory and run this function inside Matlab
%Tomasz Malisiewicz (tomasz@csail.mit.edu
%Clone my repository with Matlab-graphviz wrappers
fprintf(1,'Cloning git repositories\n');
unix(['git clone git@github.com:quantombone/' ...
'graphviz_matlab_magic.git'])
addpath(genpath(pwd))
%Download a matrix which will be rendered via Graphviz
unix('wget http://www.cise.ufl.edu/research/sparse/mat/Bai/qc324.mat')
load('qc324.mat');
A = full(real(Problem.A));
params = sexy_graph_params(A);
params.sfdp_coloring = 1;
params.file_prefix = 'synthetic';
sexy_graph(A,params);
fprintf(1,'Now open /tmp/synthetic.pdf\n');
unix('open /tmp/synthetic.pdf');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment