Commit 6c87b9b6 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix random_layout() for filtered graphs

parent 0c002fae
...@@ -604,7 +604,10 @@ def random_layout(g, shape=None, pos=None, dim=2): ...@@ -604,7 +604,10 @@ def random_layout(g, shape=None, pos=None, dim=2):
else: else:
r = [min(shape[i], 0), max(shape[i], 0)] r = [min(shape[i], 0), max(shape[i], 0)]
d = r[1] - r[0] d = r[1] - r[0]
pos[i].a = numpy.random.random(g.num_vertices()) * d + r[0]
# deal with filtering
p = pos[i].ma
p[:] = numpy.random.random(len(p)) * d + r[0]
pos = group_vector_property(pos) pos = group_vector_property(pos)
return pos return pos
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment