random_layout¶
-
random_layout
(G, dim=2, scale=1.0, center=None)[source]¶ Position nodes uniformly at random.
For every node, a position is generated by choosing each of dim coordinates uniformly at random on the default interval [0.0, 1.0), or on an interval of length \(scale\) centered at \(center\).
NumPy (http://scipy.org) is required for this function.
Parameters: Returns: pos – A dictionary of positions keyed by node
Return type: Examples
>>> G = nx.lollipop_graph(4, 3) >>> pos = nx.random_layout(G)