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
.
Diese Übung ist Teil des Kurses
Introduction to Network Analysis in Python
Anleitung zur Übung
- Import
matplotlib.pyplot
asplt
andnetworkx
asnx
. - Draw
T_sub
to the screen by using thenx.draw()
function, and don't forget to also useplt.show()
to display it.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Import necessary modules
____
____
# Draw the graph to screen
____
____