如何在gexf或networkx中为节点选择图像/图片 [英] how can i choose image/picture for my nodes in gexf or networkx

查看:78
本文介绍了如何在gexf或networkx中为节点选择图像/图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目的目的是生成网络图,我制作了一个程序,该程序以swith和python中的节点创建对象,然后生成gexf文件,我的问题是:

my project's aim is to generate a network diagram, I've made a program that creates objects as swicth and nodes in python then it generates a gexf file and my question is :

每个人都可以告诉我他是否知道一种允许我们使用gexf,networkx或其他工具选择节点映像的方法.

Can everybody tell me if he knows a way that allow us to choose a node image by using gexf, networkx or other tools.

非常感谢您

推荐答案

NetworkX支持添加任何形式的数据作为节点(例如图像)的属性:

NetworkX supports adding any form of data as attributes for a node such as an image:

G=nx.Graph() 
G.add_edge(0,1, image=my_img)

基本上所有内容都作为字典存储在下面.

Essentially everything is stored as a dictionary underneath.

这篇关于如何在gexf或networkx中为节点选择图像/图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆