本文记录Graphviz(生成由DOT语言描述的图)与ZGRViewer(查看工具)的安装及简要使用指南。去年,整理节点中心度指标时,就在找一款画图graph的工具,来得太迟了:-(
1. Graphviz
Graphviz(Graph Visualization Software)用于绘制DOT语言脚本描述的图形,DOT语言是一种描述图论的文本语言。其安装及简单使用如下:
# Graphviz sudo apt-get install graphviz # 生成图 dot -Tps filename.dot -o outfile.ps dot -Tpng filename.dot -o outfile.png # 简单例子 filename.dot digraph { b -> c; a -> b; c -> d; }
这里列出了一些简单例子,作为入门,值得一看。
1.1 dot命令
用man dot
即可查看详细文档,dot
包含如下命令:
dot # filter for drawing directed graphs neato # filter for drawing undirected graphs twopi # filter for radial layouts of graphs circo # filter for circular layout of graphs fdp # filter for drawing undirected graphs sfdp # filter for drawing large undirected graphs
The DOT Language:http://www.graphviz.org/content/dot-language
1.2 Graphviz
2. ZGRViewer
用dot
命令即可产生图。ZGRViewer使得图浏览起来更方便(比如放大、放小、overview),对于浏览大图很有用。我用ZGRViewer打开一个有8000+行的dot文件,速度很慢,也感觉不到浏览的便利(多半是我图的问题)。
点击这里下载安装包(吐槽下,官网的安装指南,压根就没有下载链接),解压:
$ unzip zgrviewer-0.9.0.zip $ cd zgrviewer/ $ ./run.sh赞赏
微信赞赏
支付宝赞赏
Pingback: The ONE使用笔记:目录 | Spark & Shine