python复杂网络库networkx:绘图draw
http://blog.csdn.net/pipisorry/article/details/54291831
networkx使用matplotlib绘制函数
draw(G[, pos, ax, hold]) |
Draw the graph G with Matplotlib. |
draw_networkx(G[, pos, arrows, with_labels]) |
Draw the graph G using Matplotlib. |
draw_networkx_nodes(G, pos[, nodelist, ...]) |
Draw the nodes of the graph G. |
draw_networkx_edges(G, pos[, edgelist, ...]) |
Draw the edges of the graph G. |
draw_networkx_labels(G, pos[, labels, ...]) |
Draw node labels on the graph G. |
draw_networkx_edge_labels(G, pos[, ...]) |
Draw edge labels. |
draw_circular(G, **kwargs) |
Draw the graph G with a circular layout. |
draw_random(G, **kwargs) |
Draw the graph G with a random layout. |
draw_spectral(G, **kwargs) |
Draw the graph G with a spectral layout. |
draw_spring(G, **kwargs) |
Draw the graph G with a spring layout. |
draw_shell(G, **kwargs) |
Draw networkx graph with shell layout. |
draw_graphviz(G[, prog]) |
Draw networkx graph with graphviz layout. |
networkx使用Graphviz AGraph (dot)绘制函数
from_agraph(A[, create_using]) |
Return a NetworkX Graph or DiGraph from a PyGraphviz graph. |
to_agraph(N) |
Return a pygraphviz graph from a NetworkX graph N. |
write_dot(G, path) |
Write NetworkX graph G to Graphviz dot format on path. |
read_dot(path) |
Return a NetworkX graph from a dot file on path. |
graphviz_layout(G[, prog, root, args]) |
Create node positions for G using Graphviz. |
|
|
Create node positions for G using Graphviz. |
networkx使用Graphviz with pydot绘制函数
from_pydot(P) |
Return a NetworkX graph from a Pydot graph. |
to_pydot(N[, strict]) |
Return a pydot graph from a NetworkX graph N. |
write_dot(G, path) |
Write NetworkX graph G to Graphviz dot format on path. |
read_dot(path) |
Return a NetworkX MultiGraph or MultiDiGraph from a dot file on path. |
graphviz_layout(G[, prog, root]) |
Create node positions using Pydot and Graphviz. |
pydot_layout(G[, prog, root]) |
Create node positions using Pydot and Graphviz. |
图布局Graph Layout
circular_layout(G[, dim, scale, center]) |
Position nodes on a circle. |
fruchterman_reingold_layout(G[, dim, k, ...]) |
Position nodes using Fruchterman-Reingold force-directed algorithm. |
random_layout(G[, dim, scale, center]) |
Position nodes uniformly at random. |
shell_layout(G[, nlist, dim, scale, center]) |
Position nodes in concentric circles. |
spring_layout(G[, dim, k, pos, fixed, ...]) |
Position nodes using Fruchterman-Reingold force-directed algorithm. |
spectral_layout(G[, dim, weight, scale, center]) |
Position nodes using the eigenvectors of the graph Laplacian. |
networkx绘图示例
def drawGraph(fg, title='weighted_graph'):
import matplotlib.pyplot as plt
import networkx as nx
pos = nx.spring_layout(fg)
nx.draw_networkx_nodes()
nx.draw_networkx_edges(fg, pos)
nx.draw_networkx_labels(fg, pos)
nx.draw_networkx_edge_labels(fg, pos, edge_labels=nx.get_edge_attributes(fg, 'weight'))
plt.savefig(os.path.join(CWD, '../PGT/middlewares/' + title + '.png'))
plt.show()
from: http://blog.csdn.net/pipisorry/article/details/54291831
ref: [Drawing]
python复杂网络库networkx:绘图draw的更多相关文章
- python复杂网络库networkx:基础
http://blog.csdn.net/pipisorry/article/details/49839251 其它复杂网络绘图库 [SNAP for python] [ArcGIS,Python,网 ...
- python复杂网络库networkx:算法
http://blog.csdn.net/pipisorry/article/details/54020333 Networks算法Algorithms 最短路径Shortest Paths shor ...
- Python 并发网络库
Python 并发网络库 Tornado VS Gevent VS Asyncio Tornado:并发网络库,同时也是一个 web 微框架 Gevent:绿色线程(greenlet)实现并发,猴子补 ...
- python复杂网络分析库NetworkX
NetworkX是一个用Python语言开发的图论与复杂网络建模工具,内置了常用的图与复杂网络分析算法,可以方便的进行复杂网络数据分析.仿真建模等工作.networkx支持创建简单无向图.有向图和多重 ...
- Python常用的库简单介绍一下
Python常用的库简单介绍一下fuzzywuzzy ,字符串模糊匹配. esmre ,正则表达式的加速器. colorama 主要用来给文本添加各种颜色,并且非常简单易用. Prettytable ...
- 使用python网络库下载
下载1000次网页资源 1,普通循环方式下载1000次,非常慢 #!/usr/bin/python # -*- coding: utf-8 -*- import sys import os impor ...
- python基于协程的网络库gevent、eventlet
python网络库也有了基于协程的实现,比较著名的是 gevent.eventlet 它两之间的关系可以参照 Comparing gevent to eventlet, 本文主要简单介绍一下event ...
- python爬虫#网络请求requests库
中文文档 http://docs.python-requests.org/zh_CN/latest/user/quickstart.html requests库 虽然Python的标准库中 urlli ...
- python 各种开源库
测试开发 来源:https://www.jianshu.com/p/ea6f7fb69501 Web UI测试自动化 splinter - web UI测试工具,基于selnium封装. 链接 sel ...
随机推荐
- 1.0 添加WEB API项目并按注释生成文档(多项目结构)
1.新建ASP.NET 项目,模板选择如图 2.选择Web API,并选择不进行身份验证方式 成功后我们看到这个结果. 至于其它三种身份验证方式,不太适合我的使用.而且这种方式也可以在代码里去实现身份 ...
- property()函数
class C: def __init__(self, size=10): self.size = size def getXSize(self): return self.size def setX ...
- Scrollbar
Scrollbar(滚动条)组件用于滚动一些组件的可见范围,可分为垂直和水平的. 用法: from tkinter import * root =Tk() #滚动条组件 sb = Scrollbar( ...
- app 下载更新 file-downloader 文件下载库的简单介绍和使用
app 下载更新 file-downloader 文件下载库的简单介绍和使用 今天介绍一个下载库:file-downloader 文件下载库 说明: * 本文内容来自原 file-downloader ...
- matlab coder 工具箱使用教程
之前一直听说matlab代码可以转C和C++代码,但是一直都没有时间尝试,最近闲着无聊,就想来试试如何转换,上网查了很多资料,照着做下去,发现都有一些问题,之后自己琢磨了很久,终于将一个很简单的例子给 ...
- springboot集成jpa
spring data jpa简介 spring data jpa是spring基于hibernate及jpa规范封装出来的一套持久层框架.该框架极大的降低了开发者工作量,提升开发效率.提供的关键字可 ...
- Sevrlet 工作原理解析-转
从 Servlet 容器说起 要介绍 Servlet 必须要先把 Servlet 容器说清楚,Servlet 与 Servlet 容器的关系有点像枪和子弹的关系,枪是为子弹而生,而子弹又让枪有了杀伤力 ...
- vue-cli的使用
1.安装node https://nodejs.org/en/download/ 2.webpack安装[我选全局安装] 全局安装 npm install --global webpack 本地安装 ...
- 重拾Python(4):Pandas之DataFrame对象的使用
Pandas有两大数据结构:Series和DataFrame,之前已对Series对象进行了介绍(链接),本文主要对DataFrame对象的常用用法进行总结梳理. 约定: import pandas ...
- [HDU 2036]改革春风吹满地
Description “ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地.谢谢!(乐队奏乐)”话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然 ...