Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
6c87b9b6
Commit
6c87b9b6
authored
Aug 12, 2011
by
Tiago Peixoto
Browse files
Fix random_layout() for filtered graphs
parent
0c002fae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/draw/__init__.py
View file @
6c87b9b6
...
...
@@ -604,7 +604,10 @@ def random_layout(g, shape=None, pos=None, dim=2):
else
:
r
=
[
min
(
shape
[
i
],
0
),
max
(
shape
[
i
],
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
)
return
pos
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment