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 ...
随机推荐
- scrapy安装教程
Step 1 •安装Python2.7(32位版本) –https://www.python.org/downloads/release/python-279/ Setp 2 •打开"运行& ...
- 如何在现有的 Web 应用中使用 ReactJS
原文:How to Sprinkle ReactJS into an Existing Web Application 译者:nzbin 当我们学习一项新技术,可能是一个 JavaScript 框架, ...
- Spring(4)——面向切面编程(AOP模块)
Spring AOP 简介 如果说 IoC 是 Spring 的核心,那么面向切面编程就是 Spring 最为重要的功能之一了,在数据库事务中切面编程被广泛使用. AOP 即 Aspect Orien ...
- 浅谈轮播图(原生JavaScript实现)
现在各种轮播图插件,玲琅满目,用起来也非常方便,通常只需要选择元素然后传入参数就可以了.但是,和授人以鱼不如授人以渔一样的道理,不管怎样最基本的轮播图原理还是应当掌握的.这样不仅有利于我们自己写出来满 ...
- 从零开始搭建口袋妖怪管理系统(1)-从Angular1.x开始
开坑,一直喜欢口袋妖怪,想着能写点有关的程序. 最近项目要改写管理系统,所以用Angular1.x搭建一个口袋妖怪管理系统试试. 巩固Ng1.x的知识+学习库的用法,然后算是记录一个系统从零开始到成型 ...
- [IOI 2011]Race
Description 给一棵树,每条边有非负权.求一条简单路径,权值和等于K,且边的数量最小.N <= 200000, 1 <= K <= 1000000 Input 第一行 两个 ...
- 多项式的基本运算(FFT和NTT)总结
设参与运算的多项式最高次数是n,那么多项式的加法,减法显然可以在O(n)时间内计算. 所以我们关心的是两个多项式的乘积.朴素的方法需要O(n^2)时间,并不够优秀. 考虑优化. 多项式乘积 方案一:分 ...
- 2015 多校联赛 ——HDU5299(树删边)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission ...
- poj 1265 Area 面积+多边形内点数
Area Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5861 Accepted: 2612 Description ...
- hdu5631 BestCoder Round #73 (div.2)
Rikka with Graph Accepts: 123 Submissions: 525 Time Limit: 2000/1000 MS (Java/Others) Memory Lim ...