Daniel@0: function draw_dot(adj); Daniel@0: % Daniel@0: % draw_dot(name) Daniel@0: % Daniel@0: % Sample code illustrating use of dot_to_graph.m function Daniel@0: % Leon Peshkin Daniel@0: if ispc, shell = 'dos'; else, shell = 'unix'; end % Which OS ? Daniel@0: Daniel@0: cmdline = strcat(shell,'(''neato -V'')'); Daniel@0: status = eval(cmdline); Daniel@0: [status, result] = dos('neato -V'); % request version to check NEATO Daniel@0: if status == 1, fprintf('Complaining \n'); exit, end Daniel@0: Daniel@0: tmpDOTfile = '_GtDout.dot'; % to be platform independant no use of directories Daniel@0: tmpLAYOUT = '_LAYout.dot'; Daniel@0: directed = 0; % assume UN-directed graph Daniel@0: graph_to_dot(adj > 0, 'directed', directed, 'filename', tmpDOTfile); % save in file Daniel@0: Daniel@0: cmdline = strcat([shell '(''neato -Tdot ' tmpDOTfile ' -o ' tmpLAYOUT ''')']); % preserve trailing spaces Daniel@0: status = eval(cmdline); % get NEATO todo layout Daniel@0: Daniel@0: [adj, labels, x, y] = dot_to_graph(tmpLAYOUT); % load layout Daniel@0: delete(tmpLAYOUT); delete(tmpDOTfile); % clean up temporary files Daniel@0: Daniel@0: figure(1); clf; axis square % now plot Daniel@0: [x, y, h] = draw_graph(adj>0, labels, zeros(size(x,2),1), x, y);