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. Spark:reduceByKey函数的用法

    reduceByKey函数API: def reduceByKey(partitioner: Partitioner, func: JFunction2[V, V, V]): JavaPairRDD[ ...

  2. 华为防火墙USG5500-企业双ISP出口

    需求:(1)技术部IP地址自动获取,网段为192.168.10.0/24,该部门访问Internet的报文正常情况下流入链路ISP1. 总经办IP地址自动获取,网段为192.168.20.0/24,该 ...

  3. JQ五星好评效果

    $(".list-txt ul").find("li").click(function(){    if($(this).index()==0){       ...

  4. MySQL慢日志功能分析及优化增强

    本文由  网易云发布. MySQL慢日志(slow log)是MySQL DBA及其他开发.运维人员需经常关注的一类信息.使用慢日志可找出执行时间较长或未走索引等SQL语句,为进行系统调优提供依据.本 ...

  5. HTTP与HTTPS

    一.HTTP和HTTPS的基本概念 HTTP:是互联网上应用最为广泛的一种网络协议,是一个客户端和服务器端请求和应答的标准(TCP),用于从WWW服务器传输超文本到本地浏览器的传输协议,它可以使浏览器 ...

  6. [SDOI 2015]序列统计

    Description 题库链接 给出集合 \(S\) ,元素都是小于 \(M\) 的非负整数.问能够生成出多少个长度为 \(N\) 的数列 \(A\) ,数列中的每个数都属于集合 \(S\) ,并且 ...

  7. NOIP2014-7-7模拟赛

    1.无线通讯网(wireless.pas/cpp/c) [题目描述] 国防部计划用无线网络连接若干个边防哨所.2种不同的通讯技术用来搭建无线网络:每个边防哨所都要配备无线电收发器:有一些哨所还可以增配 ...

  8. bzoj 2783: [JLOI2012]树

    Description 在这个问题中,给定一个值S和一棵树.在树的每个节点有一个正整数,问有多少条路径的节点总和达到S.路径中节点的深度必须是升序的.假设节点1是根节点,根的深度是0,它的儿子节点的深 ...

  9. B/S与C/S架构

    1.CS.BS架构定义 CS(Client/Server):客户端----服务器结构.C/S结构在技术上很成熟,它的主要特点是交互性强.具有安全的存取模式.网络通信量低.响应速度快.利于处理大量数据. ...

  10. if else与switch区别

    一.if-else 只是单纯地一个接一个比较:if...else每个条件都计算一遍: 二.switch 使用了Binary Tree算法:绝大部分情况下switch会快一点,除非是if-else的第一 ...