Hello all,
I am encountering a strange error in the usual gt.graph_draw when I add
vertex_size = degree. It works well every time but this time it is not
working. My code:
G = gt.Graph(directed = False)
G.add_edge_list(edges, hashed = True, string_vals = True)
gt.remove_parallel_edges(G)
lc = gt.Graph(gt.GraphView(G, vfilt = gt.label_largest_component(G)), prune
= True)
deg = lc.new_vertex_property('int')
for v in lc.vertices():
deg[v] = v.out_degree()
print(lc)
gt.graph_draw(lc, vertex_size = deg)
And I am getting the following error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line
503, in draw
self.fit_to_window(ink=False)
File "/usr/lib/python3/dist-packages/graph_tool/draw/gtk_draw.py", line
724, in fit_to_window
cr)
File "/usr/lib/python3/dist-packages/graph_tool/draw/cairo_draw.py", line
1319, in fit_to_view
font_size, cr)
File "/usr/lib/python3/dist-packages/graph_tool/draw/cairo_draw.py", line
1292, in get_bb
x_delta = [x_range[0] - (pos_x.fa - delta).min(),
ValueError: operands could not be broadcast together with shapes (4,)
(3397,)
I have 3397 vertices in my graph. I would greatly appreciate any help.
Thanks in advance.
Regards
Snehal
attachment.html (1.73 KB)