In [1]:
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
import dagology as dag
from diagram_utils import *
import os
In [2]:
diagram_folder = os.path.join(dag.DROPBOX_DAGOLOGY, 'diagrams')
In [3]:
%matplotlib inline
In [4]:
# using the conformal scattering as in Meyer1988
N = 100
D = 2
T = 1.
K = 3.5
R = dag.de_sitter_interval_kt(N, D, K*T*T)
G = dag.causal_set_graph(R)
G_tr = nx.transitive_reduction(G)
fig = plt.figure(figsize=(10,10))
ax = plt.subplot(111)
pos = {i:G.node[i]['position'][::-1] for i in G.nodes()}
nx.draw_networkx_nodes(G, pos, node_size=100, node_color=tableau20[6])
nx.draw_networkx_edges(G_tr, pos, nodelist=G.nodes(), alpha=0.5)
ax.set_xticks([])
ax.set_yticks([])
plt.axis('off')
labels = {i:i for i in G.nodes()}
figure_path = os.path.join(diagram_folder, 'ds_causet_K_%s' % str(K).replace('.', '-'))
plt.tight_layout()
for ending in ['.eps', '.pdf', '.png']:
#plt.savefig(figure_path + ending)
pass
plt.show()
In [ ]: