简体   繁体   English

Python:为社交网络生成图

[英]Python : generate a graph for a social network

I have installed matplotlib and networkx packages. 我已经安装了matplotlib和networkx软件包。 Can someone tell me the function present in these packages that can be used to generate a social network graph like graph for film actor collaborations, co-authorship or even a graph for a P2P network. 谁能告诉我这些软件包中提供的功能,这些功能可用于生成社交网络图,例如电影演员合作图,共同作者图,甚至是P2P网络图。

I think that matplotlib is not too suitable for this task. 我认为matplotlib不太适合此任务。 Try PIL instead. 请尝试使用PIL

Also, this post shows how Christian S. Perone used Ubigraph to create 3D visualization of Twitter users 此外, 本文还展示了Christian S. Perone如何使用Ubigraph创建Twitter用户的3D可视化

我将使用PyDot ,它是graphviz库的pythton绑定。

Count this as a second vote for Graphviz . 算作Graphviz的第二票。 The format is pretty simple, and the layout engine is powerful. 格式非常简单,并且布局引擎功能强大。 Having installed Graphviz, you could then add PyDot to run things, or simply write your data to files with format showing the graph structure. 安装了Graphviz之后,您可以添加PyDot来运行事物,或者只是将数据写入具有显示图结构格式的文件中。

Look at the Graphviz user's manual ( pdf ). 请参阅Graphviz用户手册( pdf )。

If you wanted to roll your own, matplotlib would be my choice, but layout is complicated. 如果您想自己动手,matplotlib是我的选择,但是布局很复杂。

You could also use graph-tool since it has an interface to graphviz, which is very easy to use. 您还可以使用graph-tool,因为它具有graphviz的界面,该界面非常易于使用。 See the documentation in the website for more details. 有关更多详细信息,请参见网站上的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM