python复杂网络库networkx:绘图draw
2017-08-14 00:00
176 查看
http://blog.csdn.net/pipisorry/article/details/54291831
皮皮blog
from: http://blog.csdn.net/pipisorry/article/details/54291831
ref: [Drawing]
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. |
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(fg, pos, node_shape='.', node_size=20) 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:绘图draw
- python复杂网络处理模块networkx
- python复杂网络库networkx:基础
- python复杂网络库networkx:基础
- python下的复杂网络编程包networkx的安装及使用
- python复杂网络库networkx:基础
- python下的复杂网络编程包networkx、matplotlib、numpy安装及报错解决方案
- 复杂网络社区结构发现算法-基于python networkx clique渗透算法
- python复杂网络分析库NetworkX
- python复杂网络库networkx:算法
- python复杂网络分析库NetworkX
- python复杂网络库networkx:算法
- python下的复杂网络编程包networkx的使用(摘抄)
- 用 python绘图及网络分析(win64下matplotlib,networkx安装方法)
- python复杂网络库networkx:算法
- 用Python的networkx绘制精美网络图
- caffe 使能python接口使用draw_net.py绘制网络结构图过程
- [转载]复杂网络分析库NetworkX学习笔记(1):入门
- 介绍几个图论和复杂网络的程序库 —— BGL,QuickGraph,igraph和NetworkX