NetworkX

Previous topic

networkx.pydot_layout

Next topic

networkx.random_layout

networkx.circular_layout

circular_layout(G, dim=2, scale=1)

Position nodes on a circle.

Parameters:

G : NetworkX graph

dim : int

Dimension of layout, currently only dim=2 is supported

scale : float

Scale factor for positions

Returns:

dict : :

A dictionary of positions keyed by node

Notes

This algorithm currently only works in two dimensions and does not try to minimize edge crossings.

Examples

>>> G=nx.path_graph(4)
>>> pos=nx.circular_layout(G)