I'm using graphviz() to create a dot layout and GraphWindow() to create a
widget in a window of said graph. When I view the graph all the vertices are
overlapping and you can differentiate between them unless you zoom all the
way in and use 'shift' to keep the vertices the same size and zoom back out.
I've tried using fit_to_window, but every time I do it throws an
AttributeError on line 568 of gtk_draw.py
cr = self.get_window().cairo_create()
AttributeError: 'NoneType' object has no attribute 'cairo_create'
I create the window as self.win = GraphWindow(etc) so I pass the graph as
self.win.graph.fit_to_window(ink=True, g=None)
What exactly should I do to make the graph widget fit into the window
without the vertices overlapping?
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Hi i am trying to get global and local clustering of price network with 10k
nodes but I am consistently getting 0.0 for both. How do I remedy that?
--
http://about.me/shubham.bhushan
I am running this code
def between(g):
import distribution as di
reload(di)
btween = betweenness(g)
v_btween = btween[0].get_array()
e_btween = btween[1].get_array()
v_dist = di.distribution(v_btween)
e_dist = di.distribution(e_btween)
print e_dist
def distribution(inlist):
import numpy as np
x = np.array(inlist)
c = np.bincount(x)
y = np.nonzero(c)[0]
value = y
count = c[y]
li = [value,count]
return li
and I am getting this error
TypeError: Cannot cast array data from dtype('float64') to dtype('int64')
according to the rule 'safe'
i tried dtype =np.int64 but then the values are getting rounded to 0 please
help. ASAP
--
http://about.me/shubham.bhushan
Can someone please help me as to how to access the property maps as an
array. i want to plot the degree distribution, betweeness and other
centrality measures. so please explicitly tell me how do I access the data.
Thanks
Shubham
--
http://about.me/shubham.bhushan
Hi
I was trying to calculate the clustering coefficients both local and global
for a Price network (Nodes =100000) but instead of returning a value it
just gives me zeroes for both local and global.
What's wrong?
SB
--
http://about.me/shubham.bhushan
Hi,
Following this example
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…>
, I try to draw the weight values on a graph as follow:
import graph_tool.all as gt
import numpy as np
mG = gt.Graph(directed = False)
#Defining properties
edgeP_image = mG.new_edge_property("object")
edgeP_weight = mG.new_edge_property("double")
vertexP_image= mG.new_edge_property("object")
mG.edge_properties["image"] = edgeP_image
mG.edge_properties["weight"] = edgeP_weight
#Building a multigraphgraph
v1 = mG.add_vertex()
v2 = mG.add_vertex()
v3 = mG.add_vertex()
mG.add_edge(v1,v1)
mG.add_edge(v1,v2)
mG.add_edge(v1,v2)
mG.add_edge(v2,v3)
mG.add_edge(v1,v3)
print mG.list_properties()
# How to set the edge weight?
e1 = mG.edge(v1,v2)
print e1.target()
edgeP_weight[e1]=5
np.random.seed(42)
for e in mG.edges():
edgeP_weight[e]=np.random.randint(1,20)
print e
gt.graph_draw(mG, eprops={"len": edgeP_weight}, output_size=(260, 260))
And this code produces the following graph:
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…>
I tried different variations without success:
{"double": edgeP_weight}
{"weight": edgeP_weight}
Best regards
Jean-Patrick
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.