Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Positionning the nodes of a graph

This is a nbot easy readable graph. How can I reposition the nodes

A= matrix([
[1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0],
[1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0],
[0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0],
[1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0],
[1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0],
[0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0],
[0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1],
[0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0],
[0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1],
[0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1]])

D = DiGraph(A, format='adjacency_matrix')
D.show()

The node shoud be

                           1 2 3
                           4 5 6
                           7 8 9

Incidently I would like to know how to change the colors of the nodes, their sizes, the number of the nodes and the arcs.

Positionning the nodes of a graph

This is a nbot easy readable graph. How can I reposition the nodes

A= matrix([
[1 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0],
[1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 , 0],
[0 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0],
[1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0],
[1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 0],
[0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0],
[0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1],
[0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0],
[0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1],
[0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1]])

D = DiGraph(A, format='adjacency_matrix')
D.show()

The node shoud be

                           1 2 3
                           4 5 6
                           7 8 9

Incidently I would like to know how to change the colors of the nodes, their sizes, the number of the nodes and the arcs.