graphviz官网:http://www.graphviz.org/

背景:有画图需要,之前见到别人用graphviz画,画出来的图漂亮,且自动帮你排版安排布局,所以自己想尝试用它画。

其中遇到的几个问题

  1. win系统下载msi安装包后进行安装,安装不成功,报错信息是win电脑却少什么包,最后转向Mac画图。
  2. 找到两个graphviz online的网站(http://www.webgraphviz.com/  和),都不太好用,不是对中文支持不好,就是稍微复杂一些的图他就画不出来了。
  3. Mac 的安装了graphviz,但是你要先保存.dot文件,编码方式选为utf-8,再用Graphviz打开,就可以支持中文。
  4. 对于如何调字体颜色,大小,形状,标签等,参考官网帮助页面都可以搞定。

为什么用这个工具画图?

  1. 自动帮你排版
  2. 如果图要改动,后续维护简单
  3. 画出来的图好看,逼格高

最后放一张自己画的图

画图用的代码:

digraph ER {
//size = "9, 15";//图片大小
//fontsize=22
compound=true;
node [shape=ellipse,fontname=微软雅黑,labelfontsize=9,fontsize=28]; u89; c1;
node [shape=box,style=filled,color=palegreen1]; a45;y78;h8;
node [shape=diamond,style=filled,color=grey92];"b1";"p9";
fontsize=25
a [shape=diamond,style=filled,color=lgrey92,label="a1"];
b [shape=diamond,style=filled,color=grey92,label="a2"]; c [shape=diamond,style=filled,color=grey92,label="a3"];
d [shape=diamond,style=filled,color=grey92,label="a4"];
u89 -> a45;
a45 -> "b1"[label="",len=1.00]; "b1" -> a [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
"b1" -> b [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
subgraph cluster_0 {
style=filled;
color=bisque;
label = "b2";
fontname=微软雅黑
node [shape=diamond,style=filled,color=grey92];"p9";
a [shape=diamond,style=filled,color=grey92,label="d7"];
c [shape=diamond,style=filled,color=grey92,label="f17"];
m [shape=box,label=y78,style=filled,color=palegreen1];
a -> m [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
a -> "p9" [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
"p9" -> c [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
"p9" -> m [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
c -> m [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
c -> h8 [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
}
subgraph cluster_1 {
//graph[rank=min;width=11;height=26];
label = "aa";
fontname=微软雅黑;
style = filled;
color=lightblue;
b [shape=diamond,style=filled,color=grey92,label="d7"];
d [shape=diamond,style=filled,color=grey92,label="f17"];
n [shape=box,label=y78,style=filled,color=palegreen1];
b -> n [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
b -> d [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
d -> n [label="是",len=1.00,fontname=微软雅黑,fontsize=25];
d -> y78 [label="否",len=1.00,fontname=微软雅黑,fontsize=25];
}
m -> c1;
n -> c1;
y78 -> c1;
h8 -> c1;
}

总结:多动手,多积累实战经验。博客园也有其他说这个工具的文章,

利用Graphviz 画结构图

Graphviz-Gdot语言学习

等。

利用Graphviz画出图的更多相关文章

  1. 利用Graphviz 画结构图[转]

    转自:http://www.cnblogs.com/sld666666/archive/2010/06/25/1765510.html 利用Graphviz 画结构图   1. Graphviz介绍 ...

  2. 利用python画出动态高优先权优先调度

    之前写过一个文章. 利用python画出SJF调度图 动态高度优先权优先调度 动态优先权调度算法,以就绪队列中各个进程的优先权作为进程调度的依据.各个进程的优先权在创建进程时所赋予,随着进程的推进或其 ...

  3. 利用LineRenderer画出一个圆,类似于lol中的攻击范围

    http://www.unity蛮牛.com/blog-5945-1409.html 本人大四狗,学unity半年有余,写此文章纯粹记录自己的心得. 废话不多说,进入主题.... 效果如图: 首先要理 ...

  4. 利用ggplot2画出各种漂亮图片详细教程

    1.Why use ggplot2 ggplot2是我见过最human friendly的画图软件,这得益于Leland Wilkinson在他的著作<The Grammar of Graphi ...

  5. 构造From窗体获取数据库数据,去除数据库中无用信息,并赋值给字段,最后画出图

    private void cbNum_SelectedIndexChanged(object sender, EventArgs e) { FieldListLug.Clear();//继续清除字段 ...

  6. 利用python画出SJF调度图

    最先发布在csdn.本人原创. https://blog.csdn.net/weixin_43906799/article/details/105510046 SJF算法: 最短作业优先(SJF)调度 ...

  7. android中利用view画出一条竖线

    在android中有时候需要通过线条来分割控件.最常见的情形就是在底部选项卡的多个button中间,通过加入一条竖线加以区分或者是在头部导航添加 竖线,将返回键和其他内容区分开来.一般会通过image ...

  8. 公告栏添加时钟——利用canvas画出一个时钟

    前言 最近在学习HTML5标签,学到Canvas,觉得很有趣.便在慕课网找了个demo练手.就是Canvas时钟. 对于canvas,w3shcool上是这么描述的: HTML5 <canvas ...

  9. 利用Excel画柱状图,并且包含最大最小值

    如何利用Excel画出如上样式的图? 1.绘制柱状图.如何绘制柱状图,操作非常简单,选中数据,点击合适的图表样式即可. 2.添加误差线.选中已绘制好的图,添加误差线.如果误差线没有出现,可以使用”更多 ...

随机推荐

  1. shell 进阶之匹配字符串

      一,操作字符串 1,字符串长度 expr 命令取字符串函数 自带shell函数读取 2,匹配字符串开头字串的长度   !!!!!!!!!!!!$substring是正则表达式.!!!!!!!!! ...

  2. (转)Shell全局变量、局部变量与特殊变量笔记总结

    Shell全局变量.局部变量与特殊变量笔记总结 原文:http://blog.csdn.net/apollon_krj/article/details/70148022 变量类型:全局变量(环境变量) ...

  3. B站视频下载(VideoHelper)

    继续上次的知乎爬虫, 这次开始了哔哩哔哩的爬虫实践: 首先介绍下如何下载吧: VideoHelper 里面有三种方式下载b站视频. 同样的流程, 还是先抓包,分析参数,寻找参数(包括之前的请求包和页面 ...

  4. nyoj 1239——引水工程——————【最小生成树 prim】

    引水工程 时间限制:2000 ms  |  内存限制:65535 KB 难度:3   描述 南水北调工程是优化水资源配置.促进区域协调发展的基础性工程,是新中国成立以来投资额最大.涉及面最广的战略性工 ...

  5. JS常用的设计模式(6)——桥接模式

    桥接模式的作用在于将实现部分和抽象部分分离开来, 以便两者可以独立的变化.在实现api的时候, 桥接模式特别有用.比如最开始的singleton的例子. var singleton = functio ...

  6. 深入理解JavaScript系列(21):S.O.L.I.D五大原则之接口隔离原则ISP

    前言 本章我们要讲解的是S.O.L.I.D五大原则JavaScript语言实现的第4篇,接口隔离原则ISP(The Interface Segregation Principle). 英文原文:htt ...

  7. [转]NLog Layout Renderers ${}

    https://github.com/nlog/NLog/wiki/Layout-Renderers Layout renderers are template macros that are use ...

  8. indexOf.substr,substring,charAt的区别

    var a = "asdfghjkl" alert(a.substr(1, 3));        //  从下标为1开始,往右数3个长度的数, 显示 sdf; alert(a.s ...

  9. 【Linux】安装配置Tomcat7

    第一步:下载Tomcat安装包 下载地址:https://tomcat.apache.org/download-70.cgi [root@localhost ~]# wget http://mirro ...

  10. git丢弃修改

    丢弃本地所有更改: git fetch origin git reset --hard origin/[对应的分支]   更改上次提交的注释: git commit --amend  会进到(vim编 ...