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 ...
随机推荐
- POJ-2570 Fiber Network---Floyd+二进制表示集合
题目链接: https://vjudge.net/problem/POJ-2570 题目大意: 一些公司决定搭建一个更快的网络,称为"光纤网".他们已经在全世界建立了许多站点,这 ...
- ng-model,ng-value,ng-bind,{{}}----angularJS数据绑定
最典型用法 双向绑定 <input type="text" value="{{apple}}" ng-model="apple" &g ...
- 单链表创建、删除、查找、插入之C语言实现
本文将详细的介绍C语言单链表的创建.删除.查找.插入以及输出功能 一.创建 #include<stdio.h> #include<stdlib.h> typedef int E ...
- Jenkins配置Gogs webhook插件
前言 我们在前面使用Jenkins集合Gogs来进行持续集成的时候,选择的是Jenkins定时检测git仓库是否有更新来决定是否构建.也就是说,我们提交了代码Jenkins并不会马上知道,那么我们可以 ...
- [LeetCode] Special Binary String 特殊的二进制字符串
Special binary strings are binary strings with the following two properties: The number of 0's is eq ...
- [LeetCode] Find the Closest Palindrome 寻找最近的回文串
Given an integer n, find the closest integer (not including itself), which is a palindrome. The 'clo ...
- 个人建站&mac下安装hexo
title: 个人建站&mac下安装hexo date: 2018-04-18 16:34:02 tags: [mac,blog,个人建站,markdown] --- 这两天使用了markdo ...
- 2015 多校联赛 ——HDU5371(manacher + 枚举)
Sample Input 1 10 2 3 4 4 3 2 2 3 4 4 Sample Output Case #1: 9 要求找出一段数字. 将其分成3部分,第①和第②部分成回文字串,第②和第 ...
- VK Cup 2017 - Round 1
和FallDream组队瞎打一通--B两个人写的都挂了233,最后只剩下FallDream写的A和我写的C,最后我yy了个E靠谱做法结果打挂了,结束之后改了改就A了,难受. AC:AC Rank:18 ...
- Unity脚本自动添加注释脚本及排版格式
Unity脚本自动添加注释脚本及头部注释排版格式 公司开发项目,需要声明版权所有,,,,标注公司名,作者,时间,项目名称及描述等等. 自己总结实现的现成脚本及头部注释排版文本,添加到模版即可. 文件不 ...