annotate toolboxes/FullBNT-1.0.7/GraphViz/Old/draw_dot.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function draw_dot(adj);
|
Daniel@0
|
2 %
|
Daniel@0
|
3 % draw_dot(name)
|
Daniel@0
|
4 %
|
Daniel@0
|
5 % Sample code illustrating use of dot_to_graph.m function
|
Daniel@0
|
6 % Leon Peshkin
|
Daniel@0
|
7 if ispc, shell = 'dos'; else, shell = 'unix'; end % Which OS ?
|
Daniel@0
|
8
|
Daniel@0
|
9 cmdline = strcat(shell,'(''neato -V'')');
|
Daniel@0
|
10 status = eval(cmdline);
|
Daniel@0
|
11 [status, result] = dos('neato -V'); % request version to check NEATO
|
Daniel@0
|
12 if status == 1, fprintf('Complaining \n'); exit, end
|
Daniel@0
|
13
|
Daniel@0
|
14 tmpDOTfile = '_GtDout.dot'; % to be platform independant no use of directories
|
Daniel@0
|
15 tmpLAYOUT = '_LAYout.dot';
|
Daniel@0
|
16 directed = 0; % assume UN-directed graph
|
Daniel@0
|
17 graph_to_dot(adj > 0, 'directed', directed, 'filename', tmpDOTfile); % save in file
|
Daniel@0
|
18
|
Daniel@0
|
19 cmdline = strcat([shell '(''neato -Tdot ' tmpDOTfile ' -o ' tmpLAYOUT ''')']); % preserve trailing spaces
|
Daniel@0
|
20 status = eval(cmdline); % get NEATO todo layout
|
Daniel@0
|
21
|
Daniel@0
|
22 [adj, labels, x, y] = dot_to_graph(tmpLAYOUT); % load layout
|
Daniel@0
|
23 delete(tmpLAYOUT); delete(tmpDOTfile); % clean up temporary files
|
Daniel@0
|
24
|
Daniel@0
|
25 figure(1); clf; axis square % now plot
|
Daniel@0
|
26 [x, y, h] = draw_graph(adj>0, labels, zeros(size(x,2),1), x, y); |