Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def default_example_decomposition():
|
|
| 45 |
|
| 46 |
ax1 = fig.add_subplot(axgrid[0, 0])
|
| 47 |
ax1.set_title("Bayesian Network")
|
| 48 |
-
pos = nx.
|
| 49 |
nx.draw_networkx(B, pos=pos, **options)
|
| 50 |
|
| 51 |
mg = nx.moral_graph(B)
|
|
@@ -58,7 +58,7 @@ def default_example_decomposition():
|
|
| 58 |
ax3.set_title("Junction Tree")
|
| 59 |
ax3.margins(0.15, 0.25)
|
| 60 |
nsize = [2000 * len(n) for n in list(jt.nodes())]
|
| 61 |
-
pos = nx.
|
| 62 |
nx.draw_networkx(jt, pos=pos, node_size=nsize, **options)
|
| 63 |
|
| 64 |
plt.tight_layout()
|
|
@@ -88,7 +88,7 @@ def create_own_graph_decomposition():
|
|
| 88 |
|
| 89 |
ax1 = fig.add_subplot(axgrid[0, 0])
|
| 90 |
ax1.set_title("Bayesian Network")
|
| 91 |
-
pos = nx.
|
| 92 |
nx.draw_networkx(G, pos=pos, **options)
|
| 93 |
|
| 94 |
mg = nx.moral_graph(G)
|
|
@@ -101,7 +101,7 @@ def create_own_graph_decomposition():
|
|
| 101 |
ax3.set_title("Junction Tree")
|
| 102 |
ax3.margins(0.15, 0.25)
|
| 103 |
nsize = [2000 * len(n) for n in list(jt.nodes())]
|
| 104 |
-
pos = nx.
|
| 105 |
nx.draw_networkx(jt, pos=pos, node_size=nsize, **options)
|
| 106 |
|
| 107 |
plt.tight_layout()
|
|
|
|
| 45 |
|
| 46 |
ax1 = fig.add_subplot(axgrid[0, 0])
|
| 47 |
ax1.set_title("Bayesian Network")
|
| 48 |
+
pos = nx.nx_pydot.pydot_layout(B, prog="neato")
|
| 49 |
nx.draw_networkx(B, pos=pos, **options)
|
| 50 |
|
| 51 |
mg = nx.moral_graph(B)
|
|
|
|
| 58 |
ax3.set_title("Junction Tree")
|
| 59 |
ax3.margins(0.15, 0.25)
|
| 60 |
nsize = [2000 * len(n) for n in list(jt.nodes())]
|
| 61 |
+
pos = nx.nx_pydot.pydot_layout(jt, prog="neato")
|
| 62 |
nx.draw_networkx(jt, pos=pos, node_size=nsize, **options)
|
| 63 |
|
| 64 |
plt.tight_layout()
|
|
|
|
| 88 |
|
| 89 |
ax1 = fig.add_subplot(axgrid[0, 0])
|
| 90 |
ax1.set_title("Bayesian Network")
|
| 91 |
+
pos = nx.nx_pydot.pydot_layout(G, prog="neato")
|
| 92 |
nx.draw_networkx(G, pos=pos, **options)
|
| 93 |
|
| 94 |
mg = nx.moral_graph(G)
|
|
|
|
| 101 |
ax3.set_title("Junction Tree")
|
| 102 |
ax3.margins(0.15, 0.25)
|
| 103 |
nsize = [2000 * len(n) for n in list(jt.nodes())]
|
| 104 |
+
pos = nx.nx_pydot.pydot_layout(jt, prog="neato")
|
| 105 |
nx.draw_networkx(jt, pos=pos, node_size=nsize, **options)
|
| 106 |
|
| 107 |
plt.tight_layout()
|