Note
Go to the end to download the full example code.
Simple path#
A minimal example of using iplotx together with networkx.
import networkx as nx
import iplotx as ipx
G = nx.path_graph(8)
pos = nx.spring_layout(G, seed=47) # Seed layout for reproducibility
ipx.network(G, layout=pos)

[<iplotx.network.NetworkArtist object at 0x7dd1fa0265d0>]
We can change the color of the vertices and edges with a touch of style:
ipx.network(
G,
layout=pos,
style={
"vertex": {
"facecolor": "lightblue",
"edgecolor": "navy",
"linewidth": 2.5,
},
"edge": {
"color": "navy",
"linewidth": 2.5,
},
},
)

[<iplotx.network.NetworkArtist object at 0x7dd1fa0ea710>]
Total running time of the script: (0 minutes 0.070 seconds)