In [ ]:
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import os
import dagology as dag
from diagram_utils import *
In [ ]:
%matplotlib inline
In [ ]:
# D=1
G = nx.DiGraph()
G.add_edges_from([['a','b'], ['b','c'], ['c','d']])
pos = {'a':[0,0],
'b':[0,1],
'c':[0,2],
'd':[0,3]}
labels={n:n for n in G.nodes()}
nx.draw(G, pos=pos, labels=labels, node_color=tableau20[7], node_size=500)
In [ ]:
# D=2
G = nx.DiGraph()
G.add_edges_from([['a','x'], ['a','y'], ['a','z'],
['b','x'], ['b','y'], ['b','z'],
['c','x'], ['c','y'], ['c','z']])
pos = {'a':[-1,0],
'b':[0,0],
'c':[1,0],
'x':[-1,2],
'y':[0,2],
'z':[1, 2]}
labels={n:n for n in G.nodes()}
nx.draw(G, pos=pos, labels=labels, node_color=tableau20[7], node_size=500)
In [ ]:
# D=3
G = nx.DiGraph()
G.add_edges_from([['a','i'], ['a','j'], ['a','k'],
['i','p'], ['i','q'],
['j','p'], ['j','r'],
['k','q'], ['k', 'r'],
['p','x'], ['q','x'], ['r','x']])
pos = {'a':[0,0],
'i':[-1,1],
'j':[0,1],
'k':[1,1],
'p':[-1,2],
'q':[0,2],
'r':[1,2],
'x':[0, 3]}
labels={n:n for n in G.nodes()}
nx.draw(G, pos=pos, labels=labels, node_color=tableau20[7], node_size=500, alpha=1)