comparison toolboxes/FullBNT-1.0.7/GraphViz/Old/draw_dot.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function draw_dot(adj);
2 %
3 % draw_dot(name)
4 %
5 % Sample code illustrating use of dot_to_graph.m function
6 % Leon Peshkin
7 if ispc, shell = 'dos'; else, shell = 'unix'; end % Which OS ?
8
9 cmdline = strcat(shell,'(''neato -V'')');
10 status = eval(cmdline);
11 [status, result] = dos('neato -V'); % request version to check NEATO
12 if status == 1, fprintf('Complaining \n'); exit, end
13
14 tmpDOTfile = '_GtDout.dot'; % to be platform independant no use of directories
15 tmpLAYOUT = '_LAYout.dot';
16 directed = 0; % assume UN-directed graph
17 graph_to_dot(adj > 0, 'directed', directed, 'filename', tmpDOTfile); % save in file
18
19 cmdline = strcat([shell '(''neato -Tdot ' tmpDOTfile ' -o ' tmpLAYOUT ''')']); % preserve trailing spaces
20 status = eval(cmdline); % get NEATO todo layout
21
22 [adj, labels, x, y] = dot_to_graph(tmpLAYOUT); % load layout
23 delete(tmpLAYOUT); delete(tmpDOTfile); % clean up temporary files
24
25 figure(1); clf; axis square % now plot
26 [x, y, h] = draw_graph(adj>0, labels, zeros(size(x,2),1), x, y);