Chinaunix首页 | 论坛 | 博客
  • 博客访问: 51881
  • 博文数量: 18
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 172
  • 用 户 组: 普通用户
  • 注册时间: 2013-02-04 14:17
文章分类

全部博文(18)

文章存档

2014年(3)

2013年(15)

我的朋友

分类: 其他平台

2013-12-09 14:45:47

算是把《DOT语言_GUIDE》中认为常用的功能都整合到一起了

点击(此处)折叠或打开

  1. digraph
  2. {
  3. //参考文档:《DOT语言_GUIDE》
  4. //图形方向
  5. rankdir=TB;//可以为LR TB BT RL
  6. label="I Love You"//图名
  7. labelloc=t;//可以是b或t
  8. labeljust=l;//可以是l或r
  9. size="50,20"; //图形长宽为20*20inch
  10. node[shape=box,color=green];//修改默认参数
  11. a->b;
  12. b->c[style=dotted];//点状连线
  13. a[shape=box,label="huang ge ming"];//修改显示内容
  14. c->{c1,c2}[style=dotted]; //两个子链接
  15. c2->c2yy[label="xie ge zhi"];//连线上加内容
  16. c2yy[style=dotted,color=red];//修改框体格式
  17. //修改连线属性
  18. b->b1[dir=both];
  19. b->b2[dir=back];
  20. b->b3[dir=forward];
  21. b->b4[dir=none];
  22. //将b1变为多边形,边数为7,层数为5,填充形式
  23. b1[shape=polygon,sides=7,peripheries=5,style=filled];
  24. //将b2变为平行四边形,斜度1,
  25. b2[shape=polygon,sides=4,skew=1];
  26. //将b3变为多边形,边数为7,层数为5,填充形式.让多边形规则化
  27. b3[shape=polygon,sides=7,peripheries=5,style=filled,regular=true];
  28. b4->{b4a,b4b};
  29. //多层图形 record 直角,Mrecord 圆角
  30. b4a[shape=record,label="left|mid\ dle|right"];
  31. b4b[shape=Mrecord,label="hello\nworld|{b|{c|d|e}|f}|g|h"];
  32. //并行图
  33. {
  34. //选择线头的出入位置,上北下南,左西右东
  35. e:n->f:s; //n,s,e,w
  36. f:se->g:nw; //ne,se,sw,nw
  37. }
  38. {
  39. //多格链接,链表图就靠它了
  40. node[shape=record];
  41. h1[label="|ONE|"];
  42. h2[label="|TWO|"];
  43. h3[label="|THREE|"];
  44. h1:f1:sw->h2:f1:ne;
  45. h2:f1->h3:f1;
  46. }
  47. //子图
  48. //将子图作为一个整体
  49. compound=true;
  50. subgraph cluster0
  51. {
  52. node[style=filled ,color=grey];
  53. label="sub 1";
  54. i1->i2;
  55. }
  56. //子图
  57. subgraph cluster1
  58. {
  59. node[style=filled ,color=grey];
  60. label="sub 2";
  61. j1->j2;
  62. }
  63. //子图整体链接
  64. i2->j1[ltail=cluster0,lhead=cluster1];
  65. }
生产图片效果:




附上:DOT语言_GUIDE.pdf
阅读(1113) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~