Aan de slagGa gratis aan de slag

Basic drawing of a network using NetworkX

NetworkX provides some basic drawing functionality that works for small graphs. We have selected a subset of nodes from the graph for you to practice using NetworkX's drawing facilities. It has been pre-loaded as T_sub.

Deze oefening maakt deel uit van de cursus

Introduction to Network Analysis in Python

Cursus bekijken

Oefeninstructies

  • Import matplotlib.pyplot as plt and networkx as nx.
  • Draw T_sub to the screen by using the nx.draw() function, and don't forget to also use plt.show() to display it.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Import necessary modules
____
____

# Draw the graph to screen
____
____
Code bewerken en uitvoeren