digraph G {
    /*全局设定
手工生成命令: dot BaseRelation.dot -Tpng -o BaseRelation.png
*/
    graph [label=".dot图例-关系约定",
        fontname="fireflysung",
        labeljust="l",labelloc="t",center=1,
        ranksep=0.2,ratio=compress,
        rankdir=TB,
        ];

    node[fontsize=10.0,
        height=0.1,
        style=filled,fillcolor=snow,
        color=darkolivegreen,fontcolor=darkolivegreen,
        shape=box,
        ];

    edge [fontsize=9.0,fontcolor=yellowgreen,
        color=gray30,
        ];

    /*图元声明*/

    nRes[label="find\n(处理)"];
    nAim[label="grep"];

    head[label="head"];
    body[label="element"];

    parent[label="getty\source"];
    sub1[label="main.c"];
    sub2[label="subr.c"];

    sanClass[label="子类"];
    rootClass[label="类"];
    object[label="对象"];

    subAPI[label="GNU/Linux"];
    mainAPI[label="POSIX"];

    depend[label="httpd.obj"];
    depended[label="httpd"];

    /*图例关系*/
    nRes->nAim          [label="关联\n(数据流)"];
    head->body          [label="指针",arrowhead=vee];
    sub1->parent        [label="Include",arrowhead=dot];
    sub2->parent        [label="组合",arrowhead=dot];
    rootClass->sanClass [label="继承",dir=back,arrowtail=odiamond,arrowhead=none];
    rootClass->object   [label="实例",arrowhead=diamond];
    mainAPI->subAPI     [label="接口实现",dir=back,arrowtail=onormal,arrowhead=none,style=dashed];
    depended->depend    [label="依赖",dir=back,arrowtail=odot,arrowhead=none,style=dashed];
}