get_node_positions

Finds the (x,y)-coordinates of nodes on the basis of the specified layout and seed values.

sasviya.network.utils.visualization.get_node_positions(g, layout='kamada_kawai', seed=None, scale_factor=None, **kwargs)

Parameters

g : SAS graph object

Specifies the graph to plot.

layout : str

Specifies the algorithm to compute the node positions. The default is ‘kamada_kawai’. The following layouts are supported: ‘bipartite’, ‘circo’, ‘circular’, ‘dot’, ‘fdp’, ‘fruchterman_reingold’, ‘kamada_kawai’, ‘multipartite’, ‘neato’, ‘planar’, ‘random’, ‘sfdp’, ‘shell’, ‘spectral’, ‘spiral’, ‘spring’, and ‘twopi’. The ‘circo’, ‘dot’, ‘fdp’, ‘neato’, ‘sfdp’, and ‘twopi’ layouts require Graphviz and pydot to be installed.

seed : int

Specifies the seed for reproducibility in random layouts.

scale_factor : float, optional

Specifies the scale factor for positions.

Returns

dict of arrays

Returns the x- and y-coordinates of each node.

Last updated: July 28, 2026