This documents the development version of NetworkX. Documentation for the current release can be found here.
shell_layout(G, nlist=None, rotate=None, scale=1, center=None, dim=2)¶
Position nodes in concentric circles.
- GNetworkX graph or list of nodes
A position will be assigned to every node in G.
- nlistlist of lists
List of node lists for each shell.
- rotateangle in radians (default=pi/len(nlist))
Angle by which to rotate the starting position of each shell relative to the starting position of the previous shell. To recreate behavior before v2.5 use rotate=0.
- scalenumber (default: 1)
Scale factor for positions.
- centerarray-like or None
Coordinate pair around which to center the layout.
Dimension of layout, currently only dim=2 is supported. Other dimension values result in a ValueError.
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) >>> shells = [, [1, 2, 3]] >>> pos = nx.shell_layout(G, shells)