我试图用networkX在python中构建一个动态图。我有一些代码来建立一个静态图形。我正在寻找一些建议,如何改变它的动态绘图,以改善可视化,也许使用networkxd3或plotly。上下文是一个对话的图表。在
nx.draw_networkx(speech, pos=nx.spring_layout(speech))
plt.draw()
static_images_dir = "./static/images"
if not os.path.exists(static_images_dir):
os.makedirs(static_images_dir)
plt.savefig(os.path.join(static_images_dir, "speech.png"))
#plt.show()
plt.close()
return speech
我不确定你所说的动态是不是这个意思,但也许是这样的?在
产生输出:
Normal static graph
Dynamic graph you can interact with
相关问题 更多 >
编程相关推荐