import networkx as nx
from torch_geometric.utils.convert import to_networkx
import matplotlib.pyplot as plt
def draw(Data): #type(Data) = <class 'torch_geometric.data.data.Data'>
G = to_networkx(Data)
nx.draw(G)
plt.show()
有个问题,不知道为什么每次生成的图看起来都不一样,欢迎交流