Python |使用 Matplotlib 可视化在 NetworkX 中生成的图形

原文:https://www . geesforgeks . org/python-visualize-graves-in-networkx-using-matplotlib/

先决条件: 使用网络 X 生成图形Matplotlib Intro 在本文中,我们将讨论如何使用 Matplotlib 在 Python 中绘制由网络 X 生成的图形。NetwX不是一个图形可视化软件包,但是软件包中包含了用 Matplotlib 进行基本绘图。

步骤 1 : 导入项目文件中的 networkx 和 matplotlib.pyplot。

Python 3

# importing networkx
import networkx as nx

# importing matplotlib.pyplot
import matplotlib.pyplot as plt