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.

pygraphviz_layout(G[, prog, root, args])

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.

皮皮blog

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的更多相关文章

  1. python复杂网络库networkx:基础

    http://blog.csdn.net/pipisorry/article/details/49839251 其它复杂网络绘图库 [SNAP for python] [ArcGIS,Python,网 ...

  2. python复杂网络库networkx:算法

    http://blog.csdn.net/pipisorry/article/details/54020333 Networks算法Algorithms 最短路径Shortest Paths shor ...

  3. Python 并发网络库

    Python 并发网络库 Tornado VS Gevent VS Asyncio Tornado:并发网络库,同时也是一个 web 微框架 Gevent:绿色线程(greenlet)实现并发,猴子补 ...

  4. python复杂网络分析库NetworkX

    NetworkX是一个用Python语言开发的图论与复杂网络建模工具,内置了常用的图与复杂网络分析算法,可以方便的进行复杂网络数据分析.仿真建模等工作.networkx支持创建简单无向图.有向图和多重 ...

  5. Python常用的库简单介绍一下

    Python常用的库简单介绍一下fuzzywuzzy ,字符串模糊匹配. esmre ,正则表达式的加速器. colorama 主要用来给文本添加各种颜色,并且非常简单易用. Prettytable ...

  6. 使用python网络库下载

    下载1000次网页资源 1,普通循环方式下载1000次,非常慢 #!/usr/bin/python # -*- coding: utf-8 -*- import sys import os impor ...

  7. python基于协程的网络库gevent、eventlet

    python网络库也有了基于协程的实现,比较著名的是 gevent.eventlet 它两之间的关系可以参照 Comparing gevent to eventlet, 本文主要简单介绍一下event ...

  8. python爬虫#网络请求requests库

    中文文档 http://docs.python-requests.org/zh_CN/latest/user/quickstart.html requests库 虽然Python的标准库中 urlli ...

  9. python 各种开源库

    测试开发 来源:https://www.jianshu.com/p/ea6f7fb69501 Web UI测试自动化 splinter - web UI测试工具,基于selnium封装. 链接 sel ...

随机推荐

  1. FTP文件上传到HDFS上

    在做测试数据时,往往会有ftp数据上传到hdfs的需求,一般需要手动操作,这样做太费事,于是有了下边代码实现的方式: ftp数据上传到hdfs函数: import java.io.InputStrea ...

  2. python操作MySQL数据库并将数据写入excel

    #!/usr/bin/python# -*- coding:utf-8 -*-'''方法:通过pymsql模块连接mysql数据库,然后通过游标cursor查询SQL语句将结果存储在Excel文件中, ...

  3. C#之PixturBox控件实现缩放和拖动图片

    一.实现鼠标滚轮控制图片缩放: 1.设置PixtureBox属性: Dock:none SizeMode:StretchImage 2.添加事件: pbxDrawing.MouseWheel += n ...

  4. 九,微信小程序开发浅谈

    最近在帮朋友做一款微信小程序(后面统称为小程序),有简单的交互,以及分享和支付功能.下面就简单的对小程序开发做一个简单的介绍,希望可以帮助大家!!! 当前的小程序我们是在windows系统里开发的,如 ...

  5. 同步IO,异步IO,阻塞IO,非阻塞IO

    同步(synchronous):一个进程在执行某个任务时,另外一个进程必须等待其执行完毕,才能继续执行 #所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不会返回.按照这个定义, 其实 ...

  6. 《C++ Primer》学习笔记:3.3.3其他vector操作

    <C++ Primer>(第五版)中计算vector对象中的索引这一小节中,举例要求计算各个分数段各有多少个成绩. 代码如下: #include <iostream> #inc ...

  7. Windows 2012服务器安装GPU版TensorFlow完全攻略

    一.首先,推荐用Anaconda安装 因为Anaconda本身就已经默认安装了很多常用的Python库,可以省去大量的库安装过程,并且解决兼容性问题. Anaconda本身的安装也非常简单,搜索Ana ...

  8. [NOI 2014]魔法森林

    Description 为了得到书法大家的真传,小E同学下定决心去拜访住在魔法森林中的隐士.魔法森林可以被看成一个包含个N节点M条边的无向图,节点标号为1..N,边标号为1..M.初始时小E同学在号节 ...

  9. NOIP2015-D2T3运输计划

    题目背景 公元 2044 年,人类进入了宇宙纪元. 题目描述 L 国有 n 个星球,还有 n-1 条双向航道,每条航道建立在两个星球之间,这 n-1 条航道连通了 L 国的所有星球. 小 P 掌管一家 ...

  10. ●BZOJ 1233 [Usaco2009Open] 干草堆 tower

    题链: http://www.lydsy.com/JudgeOnline/problem.php?id=1233 留坑.以后再来看看. (绝望,无奈,丧心...) (这个题的证明真的很诡异啊,看得我稀 ...