开始使用免费开始使用

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.

本练习是课程的一部分

Introduction to Network Analysis in Python

查看课程

练习说明

  • 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.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Import necessary modules
____
____

# Draw the graph to screen
____
____
编辑并运行代码