# pos = forceatlas.forceatlas2_layout(G, dim =3, linlog=False, nohubs=False, iterations=len(G.nodes())*5) # pos = forceatlas.forceatlas2_layout(G, pos = pos, dim =3, linlog=False, kr = 1, nohubs=True, iterations=len(G.nodes())*5, avoidoverlap = True) # # for k,v in pos.iteritems(): # # scaling tentative # # from small float like 0.5555 to higher values # # casting to int because precision is not important # pos[k] = [ i*1000-400 for i in v.tolist() ] #nx.draw(G) # nx.draw(G, pos)# pos, node_color ='r', edge_color='b') count = -1 MaxWeight = -1 # for k in G.nodes(): # if MaxWeight< G.node[k]["weight"]: # MaxWeight = G.node[k]["weight"]*1.0 cmpe = cmap_discretize(matplotlib.cm.jet, int(size)) # x = resize(arange(100), (5,100)) # djet = cmap_discretize(cm.jet, int(size)) # imshow(x, cmap=djet) #if np.mod(size, 2) ==0: colors = [cmpe(i*1024/(int(size))) for i in range(int(size))] # else) # colors = [cmpe(i*2048/int(size+1)) for i in range(int(size+1))] tutu = [G.node[tt]['degree'] for tt in G.nodes()] Maxdegs = max(tutu) for com in set(partition.values()) : count = count + 1 zoom = 6 list_nodes = [nodes for nodes in partition.keys() if partition[nodes] == com]
#pos = nx.spring_layout(G, dim=2, k=0.2, scale =1, iterations = 50000) pos = nx.graphviz_layout( G, prog='sfdp', args='-Goverlap="false" -Gsize="1000,700" -GK=20') # pos = forceatlas.forceatlas2_layout(G, dim =3, linlog=False, nohubs=False, iterations=len(G.nodes())*5) # pos = forceatlas.forceatlas2_layout(G, pos = pos, dim =3, linlog=False, kr = 1, nohubs=True, iterations=len(G.nodes())*5, avoidoverlap = True) # # for k,v in pos.iteritems(): # # scaling tentative # # from small float like 0.5555 to higher values # # casting to int because precision is not important # pos[k] = [ i*1000-400 for i in v.tolist() ] #nx.draw(G) # nx.draw(G, pos)# pos, node_color ='r', edge_color='b') count = -1 MaxWeight = -1 cmpe = cmap_discretize(matplotlib.cm.jet, int(size)) # x = resize(arange(100), (5,100)) # djet = cmap_discretize(cm.jet, int(size)) # imshow(x, cmap=djet) #if np.mod(size, 2) ==0: colors = [cmpe(i * 1024 / (int(size))) for i in range(int(size))] # else) # colors = [cmpe(i*2048/int(size+1)) for i in range(int(size+1))] zoom = 6 tutu = [G.node[tt]['degree'] for tt in G.nodes()] Maxdegs = max(tutu) for com in set(partition.values()): count = count + 1 list_nodes = [ nodes for nodes in partition.keys() if partition[nodes] == com