利用Graphviz画出图
graphviz官网:http://www.graphviz.org/
背景:有画图需要,之前见到别人用graphviz画,画出来的图漂亮,且自动帮你排版安排布局,所以自己想尝试用它画。
其中遇到的几个问题
- win系统下载msi安装包后进行安装,安装不成功,报错信息是win电脑却少什么包,最后转向Mac画图。
- 找到两个graphviz online的网站(http://www.webgraphviz.com/ 和),都不太好用,不是对中文支持不好,就是稍微复杂一些的图他就画不出来了。
- Mac 的安装了graphviz,但是你要先保存.dot文件,编码方式选为utf-8,再用Graphviz打开,就可以支持中文。
- 对于如何调字体颜色,大小,形状,标签等,参考官网帮助页面都可以搞定。
为什么用这个工具画图?
- 自动帮你排版
- 如果图要改动,后续维护简单
- 画出来的图好看,逼格高
最后放一张自己画的图

画图用的代码:
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画出图的更多相关文章
- 利用Graphviz 画结构图[转]
转自:http://www.cnblogs.com/sld666666/archive/2010/06/25/1765510.html 利用Graphviz 画结构图 1. Graphviz介绍 ...
- 利用python画出动态高优先权优先调度
之前写过一个文章. 利用python画出SJF调度图 动态高度优先权优先调度 动态优先权调度算法,以就绪队列中各个进程的优先权作为进程调度的依据.各个进程的优先权在创建进程时所赋予,随着进程的推进或其 ...
- 利用LineRenderer画出一个圆,类似于lol中的攻击范围
http://www.unity蛮牛.com/blog-5945-1409.html 本人大四狗,学unity半年有余,写此文章纯粹记录自己的心得. 废话不多说,进入主题.... 效果如图: 首先要理 ...
- 利用ggplot2画出各种漂亮图片详细教程
1.Why use ggplot2 ggplot2是我见过最human friendly的画图软件,这得益于Leland Wilkinson在他的著作<The Grammar of Graphi ...
- 构造From窗体获取数据库数据,去除数据库中无用信息,并赋值给字段,最后画出图
private void cbNum_SelectedIndexChanged(object sender, EventArgs e) { FieldListLug.Clear();//继续清除字段 ...
- 利用python画出SJF调度图
最先发布在csdn.本人原创. https://blog.csdn.net/weixin_43906799/article/details/105510046 SJF算法: 最短作业优先(SJF)调度 ...
- android中利用view画出一条竖线
在android中有时候需要通过线条来分割控件.最常见的情形就是在底部选项卡的多个button中间,通过加入一条竖线加以区分或者是在头部导航添加 竖线,将返回键和其他内容区分开来.一般会通过image ...
- 公告栏添加时钟——利用canvas画出一个时钟
前言 最近在学习HTML5标签,学到Canvas,觉得很有趣.便在慕课网找了个demo练手.就是Canvas时钟. 对于canvas,w3shcool上是这么描述的: HTML5 <canvas ...
- 利用Excel画柱状图,并且包含最大最小值
如何利用Excel画出如上样式的图? 1.绘制柱状图.如何绘制柱状图,操作非常简单,选中数据,点击合适的图表样式即可. 2.添加误差线.选中已绘制好的图,添加误差线.如果误差线没有出现,可以使用”更多 ...
随机推荐
- shell 操作符详解
= 赋值操作符,可以用于算术和字符串赋值 + 加法计算 - 减法运算 * 乘法运算 / 除法运算 ** 幂运算 % 模运算 取他除后的剩余数 因此这个十分好求公约数 += &qu ...
- Hadoop Ecosytem
There are a lot of Hadoop related projects which are open sourced and widely used by many componies. ...
- 最强json解析工具
[原]http://blog.csdn.net/xiaoguomumu/article/details/75255629 感觉上面的链接所说,需要传一个T进去,也就是先要构造T,感觉麻烦 可以不这样做 ...
- Whu 1603——Minimum Sum——————【单个元素贡献、滑窗】
Problem 1603 - Minimum Sum Time Limit: 2000MS Memory Limit: 65536KB Total Submit: 623 Accepted: ...
- Unity 基础
Unity 基础是unity入门的关键.他将讲解Unity的界面, 菜单项,使用资源,创设场景,并发布版本. 当你读完这段,你将理解unity是怎么工作的,如何有效地使用它,并且完成一个基本的游戏. ...
- javascript: Convert special characters to HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- IntelliJ IDEA 2017.3.5 安装 lombok-plugin-0.17 失败,通过网络下载总是超时
1.问题: IntelliJ IDEA 2017.3.5 安装 lombok-plugin-0.17 失败,通过网络下载总是超时: 2.原因:IntelliJ IDEA 2017.3.5 目前还不支持 ...
- mac的svn
http://xclient.info/s/cornerstone.html?t=c5242a66e53f1d866afe8c42aace2738c04ce9ee#versions 破解版的地址 打开 ...
- PLC-Heart
- 04_Spring中使用Quartz
[Spring中使用SimplerTrigger] [QuartzTask.java] package com.higgin.task; import java.text.SimpleDateForm ...