networkX 可视化图 visibility graph 如何根据时间序列得到图

networkX 可视化图

如何根据时间序列得到图

from visibility_graph import visibility_graph
series = [0.87, 0.49, 0.36, 0.83, 0.87]
g = visibility_graph(series)
g.nodes()
g.edges()

import matplotlib.pyplot as plt
import networkx as nx
nx.draw(g)
plt.show()
posted @ 2022-07-20 19:53  bH1pJ  阅读(36)  评论(0编辑  收藏  举报