- circular_layout(G, scale=1, center=None, dim=2)¶
Position nodes on a circle.
- GNetworkX graph or list of nodes
A position will be assigned to every node in G.
- scalenumber (default: 1)
Scale factor for positions.
- centerarray-like or None
Coordinate pair around which to center the layout.
Dimension of layout. If dim>2, the remaining dimensions are set to zero in the returned positions. If dim<2, a ValueError is raised.
A dictionary of positions keyed by node
If dim < 2
This algorithm currently only works in two dimensions and does not try to minimize edge crossings.
>>> G = nx.path_graph(4) >>> pos = nx.circular_layout(G)