

"""Makes a nice plot of the probabilities for each state and its energy

Plt.text(0.02, 0.02, text, transform=plt.gca().transAxes) #, font_family='monospace')ĭef plot_probabilities(probabilities: Union, Nx.draw(G, pos, node_size=20, alpha=0.5, node_color="blue", with_labels=False) #pos = nx.graphviz_layout(G, prog='dot', args='') This is suitable for certain diagrams of multiple cyclic structures, such as certain telecommunications networks. Nodes are placed on concentric circles depending their distance from a given root node.Ĭirco - circular layout, after Six and Tollis 99, Kauffman and Wiese 02. Twopi - radial layouts, after Graham Wills 97. Sfdp - multiscale version of fdp for the layout of large graphs. Neato attempts to minimize a global energy function, which is equivalent to statistical multi-dimensional scaling.įdp - "spring model'' layouts similar to those of neato, but does this by reducing forces rather than working with energy.

This is the default tool to use if the graph is not too large (about 100 nodes) and you don't know anything else about it. This is the default tool to use if edges have directionality. Invis_edges = list(ut.itertwo(ttype_nodes))Īgraph = nx.nx_agraph.to_agraph(netx_graph2)ĭot - "hierarchical" or layered drawings of directed graphs. Ttype_nodes = ut.list_getattr(ttype_cpds, 'variable') If getattr(model, 'ttype2_cpds', None) is not None: # Hack for layout (ordering of top level nodes) # Add "invisible" edges to induce an ordering Def get_bayesnet_layout(model, name_nodes=None, prog='dot'):Įnsures ordering of layers is in order of addition via templates
