Daniel@0: function mk_ps_from_clqs(dbn, T, cliques, dir) Daniel@0: Daniel@0: % Draw multiple copies of the DBN, Daniel@0: % and indicate the nodes in each clique by shading the nodes. Daniel@0: % Generate a series of color postscript files, Daniel@0: % or, if dir=[], displays them to the screen and pauses. Daniel@0: Daniel@0: if isempty(dir) Daniel@0: print_to_file = 0; Daniel@0: else Daniel@0: print_to_file = 1; Daniel@0: end Daniel@0: Daniel@0: if print_to_file, cd(dir), end Daniel@0: flip = 1; Daniel@0: clf; Daniel@0: [dummyx, dummyy, h] = draw_dbn(dbn.intra, dbn.inter, flip, T, -1); Daniel@0: Daniel@0: C = length(cliques); Daniel@0: Daniel@0: % nodes = []; Daniel@0: % for i=1:C Daniel@0: % cl = cliques{i}; Daniel@0: % nodes = [nodes cl(:)']; Daniel@0: % end Daniel@0: %nodes = unique(nodes); Daniel@0: ss = length(dbn.intra); Daniel@0: nodes = 1:(ss*T); Daniel@0: Daniel@0: for c=1:C Daniel@0: for i=cliques{c} Daniel@0: set(h(i,2), 'facecolor', 'r'); Daniel@0: end Daniel@0: rest = mysetdiff(nodes, cliques{c}); Daniel@0: for i=rest Daniel@0: set(h(i,2), 'facecolor', 'w'); Daniel@0: end Daniel@0: if print_to_file Daniel@0: print(gcf, '-depsc', sprintf('clq%d.ps', c)) Daniel@0: else Daniel@0: disp(['clique ' num2str(c) ' = ' num2str(cliques{c}) '; hit key for next']) Daniel@0: pause Daniel@0: end Daniel@0: end