Module Expr Str ImportFrom alias Import alias Import alias identifier Assign NameStore ListLoad Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Import alias identifier If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq Call NameLoad NameLoad NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str Import alias identifier Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore TupleLoad Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad Num body Expr Str Import alias identifier Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore Dict orelse If CompareEq Call NameLoad NameLoad Num body Assign NameStore Dict SubscriptLoad Call AttributeLoad NameLoad attr Index Num NameLoad orelse Assign NameStore BinOpMult BinOpMult SubscriptLoad Call AttributeLoad NameLoad attr Num Num BinOpAdd Call NameLoad NameLoad Num Slice Num Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call NameLoad NameLoad keyword NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad Num body Expr Str Import alias identifier Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Return Dict If CompareEq Call NameLoad NameLoad Num body Return Dict Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Call NameLoad NameLoad If CompareEq Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign NameStore Num orelse Assign NameStore Num Assign NameStore Dict For NameStore NameLoad body Assign NameStore BinOpMult BinOpMult SubscriptLoad Call AttributeLoad NameLoad attr Num Num BinOpAdd Call NameLoad NameLoad Num Slice Num Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call NameLoad NameLoad keyword BinOpDiv BinOpMult NameLoad NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Num Str Num NameLoad Num body Expr Str Import alias identifier Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad Call NameLoad NameLoad Call NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore TupleLoad Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore NameLoad If CompareEq Call NameLoad NameLoad Num body Return Dict If CompareEq Call NameLoad NameLoad Num body Return Dict Call NameLoad Call AttributeLoad NameLoad attr NameLoad TryExcept body If CompareLt Call NameLoad NameLoad Num body Raise NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str If BoolOpAnd CompareIs NameLoad NameLoad CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If BoolOpAnd CompareIs NameLoad NameLoad CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore BinOpAdd Call NameLoad NameLoad keyword NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Num Num body TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad TryExcept body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv Num NameLoad Assign NameStore BinOpMult Call NameLoad BinOpSub Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpSub Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore BinOpDiv NameLoad Call NameLoad BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num keyword AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign SubscriptStore NameLoad ExtSlice Slice Slice Index NameLoad BinOpSub SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Index NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad BinOpPow NameLoad Num attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr CompareLt NameLoad Num Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpMult Call AttributeLoad NameLoad attr NameLoad BinOpSub BinOpDiv BinOpMult NameLoad NameLoad BinOpPow NameLoad Num BinOpDiv BinOpMult NameLoad NameLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad BinOpPow NameLoad Num attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr CompareLt NameLoad Num Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Num AugAssignAdd NameStore NameLoad AugAssignSub NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Num Num body TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad TryExcept body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call AttributeLoad NameLoad attr NameLoad TryExcept body ImportFrom alias alias handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler body Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore ListLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv Num NameLoad Assign NameStore Num Assign NameStore BinOpDiv NameLoad Call NameLoad BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body AugAssignMult NameStore Num For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body If CompareIn NameLoad NameLoad body Continue Assign NameStore AttributeLoad BinOpSub SubscriptLoad NameLoad Index NameLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad BinOpPow NameLoad Num attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr CompareLt NameLoad Num Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Index NameLoad Call AttributeLoad BinOpMult NameLoad BinOpSub BinOpDiv BinOpMult NameLoad NameLoad BinOpPow NameLoad Num BinOpDiv BinOpMult NameLoad NameLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad BinOpPow NameLoad Num attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr CompareLt NameLoad Num Num NameLoad AugAssignAdd NameStore AttributeLoad BinOpDiv BinOpMult NameLoad NameLoad NameLoad attr AugAssignSub NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str Num NameLoad Num body Expr Str Import alias identifier Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad If CompareLtE Call NameLoad NameLoad Num body If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr ListLoad orelse If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad Num Return Call NameLoad Call NameLoad NameLoad NameLoad TryExcept body If CompareLt Call NameLoad NameLoad Num body Raise NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str If Call AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If Call AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad TryExcept body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore BinOpSub NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num BinOpAdd NameLoad Num Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body TryExcept body Import alias identifier ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call NameLoad NameLoad TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias identifier TryExcept body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Str Raise Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad Call AttributeLoad NameLoad attr keyword Num attr Assign NameStore Call NameLoad NameLoad Num NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call NameLoad BinOpAdd BinOpMult Num NameLoad Num Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad keyword Str keyword NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num NameLoad Return Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Num For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body AugAssignSub SubscriptStore NameLoad ExtSlice Slice Index NameLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr NameLoad If CompareGt NameLoad Num body For NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body AugAssignMult SubscriptStore NameLoad ExtSlice Slice Index NameLoad BinOpDiv NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body ImportFrom alias TryExcept body Import alias handlers ExceptHandler body Raise Call NameLoad Str TryExcept body Import alias handlers ExceptHandler body Raise Call NameLoad Str decorator_list
N/A N/A 
******
Layout
******

Node positioning algorithms for graph drawing.

For `random_layout()` the possible resulting shape
is a square of side [0, scale] (default: [0, 1])
Changing `center` shifts the layout by that amount.

For the other layout routines, the extent is
[center - scale, center + scale] (default: [-1, 1]).

Warning: Most layout routines have only been tested in 2-dimensions.

 __future__ division N/A collections N/A networkx nx N/A __all__ N/A circular_layout random_layout rescale_layout shell_layout spring_layout spectral_layout fruchterman_reingold_layout _process_params N/A N/A G center dim N/A N/A N/A numpy np N/A N/A N/A isinstance G N/A nx Graph N/A N/A empty_graph N/A N/A nx Graph N/A N/A N/A empty_graph add_nodes_from G N/A G empty_graph N/A N/A center None N/A N/A center N/A N/A np zeros dim N/A N/A center N/A N/A np asarray center N/A N/A N/A len center dim N/A N/A msg length of center coordinates must match dimension of layout N/A N/A ValueError msg N/A N/A G center N/A random_layout N/A N/A G center dim N/A None 2 N/A N/A Position nodes uniformly at random in the unit square.

    For every node, a position is generated by choosing each of dim
    coordinates uniformly at random on the interval [0.0, 1.0).

    NumPy (http://scipy.org) is required for this function.

    Parameters
    ----------
    G : NetworkX graph or list of nodes
        A position will be assigned to every node in G.

    center : array-like or None
        Coordinate pair around which to center the layout.

    dim : int
        Dimension of layout.

    Returns
    -------
    pos : dict
        A dictionary of positions keyed by node

    Examples
    --------
    >>> G = nx.lollipop_graph(4, 3)
    >>> pos = nx.random_layout(G)

     N/A numpy np N/A N/A G center N/A _process_params G center dim N/A shape N/A N/A len G dim N/A pos N/A N/A N/A N/A np random random shape center N/A pos N/A N/A pos astype N/A np float32 N/A pos N/A dict N/A zip G pos N/A pos N/A circular_layout N/A N/A G scale center dim N/A 1 None 2 N/A N/A Position nodes on a circle.

    Parameters
    ----------
    G : NetworkX graph or list of nodes

    scale : float
        Scale factor for positions

    center : array-like or None
        Coordinate pair around which to center the layout.

    dim : int
        Dimension of layout, currently only dim=2 is supported

    Returns
    -------
    pos : dict
        A dictionary of positions keyed by node

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

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

     N/A numpy np N/A N/A G center N/A _process_params G center dim N/A N/A N/A len G 0 N/A N/A pos N/A N/A N/A N/A N/A len G 1 N/A N/A pos N/A N/A N/A N/A G nodes N/A 0 center N/A N/A theta N/A N/A N/A N/A N/A np linspace 0 1 N/A N/A len G 1 N/A -1 2 N/A np pi N/A theta N/A N/A theta astype N/A np float32 N/A pos N/A N/A np column_stack N/A N/A N/A np cos theta N/A N/A np sin theta N/A pos N/A N/A rescale_layout pos scale scale center N/A pos N/A dict N/A zip G pos N/A pos N/A shell_layout N/A N/A G nlist scale center dim N/A None 1 None 2 N/A N/A Position nodes in concentric circles.

    Parameters
    ----------
    G : NetworkX graph or list of nodes

    nlist : list of lists
       List of node lists for each shell.

    scale : float
        Scale factor for positions

    center : array-like or None
        Coordinate pair around which to center the layout.

    dim : int
        Dimension of layout, currently only dim=2 is supported

    Returns
    -------
    pos : dict
        A dictionary of positions keyed by node

    Examples
    --------
    >>> G = nx.path_graph(4)
    >>> shells = [[0], [1, 2, 3]]
    >>> pos = nx.shell_layout(G, shells)

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

     N/A numpy np N/A N/A G center N/A _process_params G center dim N/A N/A N/A len G 0 N/A N/A N/A N/A N/A N/A len G 1 N/A N/A N/A N/A N/A N/A nx utils arbitrary_element G center N/A N/A nlist None N/A N/A nlist N/A N/A list G N/A N/A N/A len N/A nlist N/A 0 1 N/A N/A radius 0.0 N/A N/A radius 1.0 N/A npos N/A N/A nodes nlist N/A N/A theta N/A N/A N/A N/A N/A np linspace 0 1 N/A N/A len nodes 1 N/A -1 2 N/A np pi N/A theta N/A N/A theta astype N/A np float32 N/A pos N/A N/A np column_stack N/A N/A N/A np cos theta N/A N/A np sin theta N/A pos N/A N/A rescale_layout pos scale N/A N/A scale radius N/A len nlist center N/A N/A N/A npos update N/A zip nodes pos N/A radius 1.0 N/A npos N/A fruchterman_reingold_layout N/A N/A G k pos fixed iterations weight scale center dim N/A None None None 50 weight 1.0 None 2 N/A N/A Position nodes using Fruchterman-Reingold force-directed algorithm.

    Parameters
    ----------
    G : NetworkX graph or list of nodes

    k : float (default=None)
        Optimal distance between nodes.  If None the distance is set to
        1/sqrt(n) where n is the number of nodes.  Increase this value
        to move nodes farther apart.

    pos : dict or None  optional (default=None)
        Initial positions for nodes as a dictionary with node as keys
        and values as a coordinate list or tuple.  If None, then use
        random initial positions.

    fixed : list or None  optional (default=None)
        Nodes to keep fixed at initial position.

    iterations : int  optional (default=50)
        Number of iterations of spring-force relaxation

    weight : string or None   optional (default='weight')
        The edge attribute that holds the numerical value used for
        the edge weight.  If None, then all edge weights are 1.

    scale : float (default=1.0)
        Scale factor for positions. The nodes are positioned
        in a box of size [0, scale] x [0, scale].

    center : array-like or None
        Coordinate pair around which to center the layout.

    dim : int
        Dimension of layout

    Returns
    -------
    pos : dict
        A dictionary of positions keyed by node

    Examples
    --------
    >>> G = nx.path_graph(4)
    >>> pos = nx.spring_layout(G)

    # The same using longer but equivalent function name
    >>> pos = nx.fruchterman_reingold_layout(G)
     N/A numpy np N/A N/A G center N/A _process_params G center dim N/A N/A fixed None N/A N/A nfixed N/A dict N/A zip G N/A range N/A len G N/A fixed N/A N/A np asarray N/A N/A nfixed N/A v N/A v fixed N/A N/A pos None N/A N/A dom_size N/A max N/A coord N/A coord pos_tup N/A pos_tup N/A N/A pos values N/A shape N/A N/A len G dim N/A pos_arr N/A N/A N/A N/A N/A np random random shape dom_size center N/A N/A i n N/A enumerate G N/A N/A N/A n pos N/A N/A N/A pos_arr N/A i N/A N/A np asarray N/A pos N/A n N/A N/A pos_arr None N/A N/A N/A len G 0 N/A N/A N/A N/A N/A N/A len G 1 N/A N/A N/A N/A next N/A N/A G nodes center N/A N/A N/A N/A N/A len G 500 N/A N/A ValueError N/A A N/A N/A nx to_scipy_sparse_matrix G weight weight dtype f N/A N/A N/A k None N/A fixed None N/A N/A N/A nnodes _ N/A A shape N/A k N/A dom_size N/A N/A np sqrt nnodes N/A pos N/A _sparse_fruchterman_reingold A k pos_arr fixed iterations dim N/A N/A N/A N/A A N/A N/A nx to_numpy_matrix G weight weight N/A N/A N/A k None N/A fixed None N/A N/A N/A nnodes _ N/A A shape N/A k N/A dom_size N/A N/A np sqrt nnodes N/A pos N/A _fruchterman_reingold A k pos_arr fixed iterations dim N/A N/A fixed None N/A N/A pos N/A N/A rescale_layout pos scale scale center N/A pos N/A dict N/A zip G pos N/A pos N/A N/A spring_layout fruchterman_reingold_layout _fruchterman_reingold N/A N/A A k pos fixed iterations dim N/A None None None 50 2 N/A N/A N/A N/A numpy np N/A N/A N/A ImportError N/A N/A msg _fruchterman_reingold() requires numpy: http://scipy.org/  N/A N/A ImportError msg N/A N/A N/A N/A nnodes _ N/A A shape N/A N/A N/A AttributeError N/A N/A msg fruchterman_reingold() takes an adjacency matrix as input N/A N/A N/A nx NetworkXError msg N/A A N/A N/A np asarray A N/A N/A pos None N/A N/A pos N/A N/A np asarray N/A N/A N/A np random random N/A nnodes dim dtype N/A A dtype N/A N/A pos N/A N/A pos astype N/A A dtype N/A N/A k None N/A N/A k N/A N/A np sqrt N/A 1.0 nnodes N/A t N/A N/A max N/A N/A max N/A N/A pos T N/A 0 N/A min N/A N/A pos T N/A 0 N/A N/A max N/A N/A pos T N/A 1 N/A min N/A N/A pos T N/A 1 0.1 N/A dt N/A t N/A float N/A iterations 1 N/A delta N/A N/A np zeros N/A N/A N/A pos shape N/A 0 N/A N/A pos shape N/A 0 N/A N/A pos shape N/A 1 dtype N/A A dtype N/A iteration N/A range iterations N/A N/A i N/A range N/A N/A pos shape N/A 1 N/A N/A N/A delta N/A N/A N/A N/A i N/A N/A pos N/A N/A N/A i N/A None N/A pos N/A N/A N/A i N/A distance N/A N/A np sqrt N/A N/A N/A delta 2 sum axis -1 N/A distance N/A N/A np where N/A distance 0.01 0.01 distance N/A displacement N/A N/A N/A N/A np transpose N/A N/A N/A np transpose delta N/A N/A N/A k k N/A distance 2 N/A N/A A distance k sum axis 1 N/A length N/A N/A np sqrt N/A N/A N/A displacement 2 sum axis 1 N/A length N/A N/A np where N/A length 0.01 0.1 length N/A delta_pos N/A N/A np transpose N/A N/A N/A N/A np transpose displacement t length N/A N/A fixed None N/A N/A N/A delta_pos N/A fixed 0.0 N/A pos delta_pos N/A t dt N/A pos N/A _sparse_fruchterman_reingold N/A N/A A k pos fixed iterations dim N/A None None None 50 2 N/A N/A N/A N/A numpy np N/A N/A N/A ImportError N/A N/A m _sparse_fruchterman_reingold() requires numpy: http://scipy.org/ N/A N/A ImportError m N/A N/A N/A N/A nnodes _ N/A A shape N/A N/A N/A AttributeError N/A N/A msg fruchterman_reingold() takes an adjacency matrix as input N/A N/A N/A nx NetworkXError msg N/A N/A scipy.sparse spdiags coo_matrix N/A N/A N/A ImportError N/A N/A msg _sparse_fruchterman_reingold() scipy numpy: http://scipy.org/  N/A N/A ImportError msg N/A N/A N/A A N/A N/A A tolil N/A N/A N/A N/A A N/A N/A N/A coo_matrix A tolil N/A N/A pos None N/A N/A pos N/A N/A np asarray N/A N/A N/A np random random N/A nnodes dim dtype N/A A dtype N/A N/A pos N/A N/A pos astype N/A A dtype N/A N/A fixed None N/A N/A fixed N/A N/A N/A k None N/A N/A k N/A N/A np sqrt N/A 1.0 nnodes N/A t 0.1 N/A dt N/A t N/A float N/A iterations 1 N/A displacement N/A N/A np zeros N/A dim nnodes N/A iteration N/A range iterations N/A N/A displacement 0 N/A i N/A range N/A N/A A shape N/A 0 N/A N/A N/A i fixed N/A N/A N/A delta N/A N/A N/A pos N/A i pos T N/A distance N/A N/A np sqrt N/A N/A N/A delta 2 sum axis 0 N/A distance N/A N/A np where N/A distance 0.01 0.01 distance N/A Ai N/A N/A np asarray N/A N/A N/A N/A A getrowview i toarray N/A N/A displacement N/A N/A N/A i N/A N/A N/A delta N/A N/A N/A k k N/A distance 2 N/A N/A Ai distance k sum axis 1 N/A length N/A N/A np sqrt N/A N/A N/A displacement 2 sum axis 0 N/A length N/A N/A np where N/A length 0.01 0.1 length N/A pos N/A N/A N/A displacement t length T N/A t dt N/A pos N/A spectral_layout N/A N/A G weight scale center dim N/A weight 1 None 2 N/A N/A Position nodes using the eigenvectors of the graph Laplacian.

    Parameters
    ----------
    G : NetworkX graph or list of nodes

    weight : string or None   optional (default='weight')
        The edge attribute that holds the numerical value used for
        the edge weight.  If None, then all edge weights are 1.

    scale : float
        Scale factor for positions

    center : array-like or None
        Coordinate pair around which to center the layout.

    dim : int
        Dimension of layout

    Returns
    -------
    pos : dict
        A dictionary of positions keyed by node

    Examples
    --------
    >>> G = nx.path_graph(4)
    >>> pos = nx.spectral_layout(G)

    Notes
    -----
    Directed graphs will be considered as undirected graphs when
    positioning the nodes.

    For larger graphs (>500 nodes) this will use the SciPy sparse
    eigenvalue solver (ARPACK).
     N/A numpy np N/A N/A G center N/A _process_params G center dim N/A N/A N/A len G 2 N/A N/A N/A N/A len G 0 N/A N/A pos N/A N/A np array N/A N/A N/A N/A N/A len G 1 N/A N/A pos N/A N/A np array N/A center N/A N/A pos N/A N/A np array N/A N/A N/A np zeros dim N/A N/A N/A np array center 2.0 N/A N/A dict N/A zip G pos N/A N/A N/A N/A N/A len G 500 N/A N/A ValueError N/A A N/A N/A nx to_scipy_sparse_matrix G weight weight dtype d N/A N/A N/A G is_directed N/A N/A A N/A A N/A N/A np transpose A N/A pos N/A _sparse_spectral A dim N/A N/A N/A N/A ImportError ValueError N/A N/A A N/A N/A nx to_numpy_matrix G weight weight N/A N/A N/A G is_directed N/A N/A A N/A A N/A N/A np transpose A N/A pos N/A _spectral A dim N/A pos N/A N/A rescale_layout pos scale center N/A pos N/A dict N/A zip G pos N/A pos N/A _spectral N/A N/A A dim N/A 2 N/A N/A N/A N/A numpy np N/A N/A N/A ImportError N/A N/A msg spectral_layout() requires numpy: http://scipy.org/  N/A N/A ImportError msg N/A N/A N/A N/A nnodes _ N/A A shape N/A N/A N/A AttributeError N/A N/A msg spectral() takes an adjacency matrix as input N/A N/A N/A nx NetworkXError msg N/A A N/A N/A np asarray A N/A I N/A N/A np identity nnodes dtype N/A A dtype N/A D N/A I N/A N/A np sum A axis 1 N/A L N/A D A N/A N/A eigenvalues eigenvectors N/A N/A N/A np linalg eig L N/A index N/A N/A N/A np argsort eigenvalues N/A 1 N/A dim 1 N/A N/A N/A np real N/A eigenvectors N/A N/A N/A index N/A _sparse_spectral N/A N/A A dim N/A 2 N/A N/A N/A N/A numpy np scipy.sparse spdiags N/A N/A N/A ImportError N/A N/A msg _sparse_spectral() requires scipy & numpy: http://scipy.org/  N/A N/A ImportError msg N/A N/A scipy.sparse.linalg.eigen eigsh N/A N/A N/A ImportError N/A scipy.sparse.linalg eigen_symmetric eigsh N/A N/A N/A N/A nnodes _ N/A A shape N/A N/A N/A AttributeError N/A N/A msg sparse_spectral() takes an adjacency matrix as input N/A N/A N/A nx NetworkXError msg N/A data N/A N/A np asarray N/A N/A N/A A sum axis 1 T N/A D N/A spdiags data 0 nnodes nnodes N/A L N/A D A N/A k N/A dim 1 N/A ncv N/A max N/A N/A 2 k 1 N/A int N/A N/A np sqrt nnodes N/A N/A eigenvalues eigenvectors N/A eigsh L k which SM ncv ncv N/A index N/A N/A N/A np argsort eigenvalues N/A 1 k N/A N/A N/A np real N/A eigenvectors N/A N/A N/A index N/A rescale_layout N/A N/A pos scale N/A 1 N/A N/A Return scaled position array to (-scale, scale) in all axes.

    The function acts on NumPy arrays which hold position information.
    Each position is one row of the array. The dimension of the space
    equals the number of columns. Each coordinate in one column.

    To rescale, the mean (center) is subtracted from each axis separately.
    Then all values are scaled so that the largest magnitude value
    from all axes equals `scale` (thus, the aspect ratio is preserved).
    The resulting NumPy Array is returned (order of rows unchanged).

    Parameters
    ----------
    pos : numpy array
        positions to be scaled. Each row is a position.

    scale : number (default: 1)
        The size of the resulting extent in all directions.

    Returns
    -------
    pos : numpy array
        scaled positions. Each row is a position.

     N/A lim 0 N/A i N/A range N/A N/A pos shape N/A 1 N/A N/A N/A pos N/A N/A N/A i N/A N/A N/A pos N/A N/A N/A i mean N/A lim N/A max N/A N/A N/A pos N/A N/A N/A i max lim N/A N/A lim 0 N/A N/A i N/A range N/A N/A pos shape N/A 1 N/A N/A N/A pos N/A N/A N/A i N/A scale lim N/A pos N/A setup_module N/A N/A module N/A N/A nose SkipTest N/A N/A N/A numpy N/A N/A N/A N/A N/A SkipTest NumPy not available N/A N/A N/A scipy N/A N/A N/A N/A N/A SkipTest SciPy not available N/A