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 ...
随机推荐
- spark2.1:使用df.select(when(a===b,1).otherwise(0))替换(case when a==b then 1 else 0 end)
最近工作中把一些sql.sh脚本执行hive的语句升级为spark2.1版本,其中遇到将case when 替换为scala操作df的方式实现的问题: 代码数据: scala> import o ...
- c# IPC实现本机进程之间的通信
IPC可以实现本地进程之间通信.这种用法不是太常见,常见的替代方案是使用wcf,remoting,web service,socket(tcp/pipe/...)等其他分布式部署方案来替代进程之间的通 ...
- 03、NetCore2.0下Web应用之搭建最小框架
03.NetCore2.0下Web应用之搭建最小框架 这里我们不使用VS2017或者CLI命令的方式创建Asp.Net Core 2.0网页应用程序,而是完全手工的一点点搭建一个Web框架,以便更好的 ...
- NGUI----简单聊天系统一
1:聊天背景的创建 新建一个场景-----保存场景 NGUI---->Create-----Panel 选中UIRoot,然后新建一个sprite 选择图集 效果如下图 添加一个可拖拽的功能 选 ...
- Spring MVC基础学习
SpringMVC是Spring框架的一个模块,无需通过中间层整合在一起.SpringMVC是一个基于MVC设计模式web框架,MVC-model-view-controller:MVC将服务器端分为 ...
- java之设计模式工厂三兄弟之工厂方法模式
[学习难度:★★☆☆☆,使用频率:★★★★★] 简单工厂模式虽然简单,但存在一个很严重的问题.当系统中需要引入新产品时,由于静态工厂方法通过所传入参数的不同来创建不同的产品,这必定要修改工厂类的源代码 ...
- Apache 安装与配置(WIN10)
本地坏境:windows 10 Pro 1709 Apache版本:httpd-2.4.32-Win64-VC15 Apache下载地址:https://www.apachelounge.com/do ...
- 初探java对象比较
判断两个对象的属性值是否相等的方法, class Book{ private String title; private double price; public Book(String title, ...
- [LeetCode] Decode Ways II 解码方法之二
A message containing letters from A-Z is being encoded to numbers using the following mapping way: ' ...
- bzoj4896 补退选
Description X是T大的一名老师,每年他都要教授许多学生基础的C++知识.在T大,每个学生在每学期的开学前都需要选课,每 次选课一共分为三个阶段:预选,正选,补退选:其中"补退选& ...