【问题标题】:How to define a node shape in graphviz?如何在graphviz中定义节点形状?
【发布时间】:2012-07-03 01:44:02
【问题描述】:

我想画圆作为点中的节点。我正在使用以下应该绘制圆圈的简单代码。但它会画出日食。这是我的代码:

digraph G {
node [ shape=circle, width=0.5, height = 0.5, fixedsize=true]
Node1  -> Node1 ;
Node1 -> Node2;
Node2 -> Node1;
Node2 -> Node2;
};

这就是我得到的:

如何画圆?

【问题讨论】:

    标签: graphviz dot


    【解决方案1】:

    您的文件中的所有内容都绝对正确。必须有圆圈。

    【讨论】:

      【解决方案2】:

      使用shape="circle" 应该可以工作,例如:

      digraph G {
      0 [color="aqua", label="A", shape="circle", style="filled"];
      1 [color="bisque", label="B", shape="circle", style="filled"];
      2 [color="blue", label="C", shape="circle", style="filled"];
      3 [color="blueviolet", label="E", shape="circle", style="filled"];
      4 [color="brown", label="D", shape="circle", style="filled"];
      5 [color="burlywood", label="F", shape="circle", style="filled"];
      6 [color="cadetblue", label="G", shape="circle", style="filled"];
      0->0 ;
      0->1;
      1->4;
      2->2;
      2->3;
      3->4;
      4->4;
      4->5;
      4->6;
      5->0;
      6->2;
      }
      

      【讨论】:

        【解决方案3】:
        digraph G {
        node [ shape="circle", width=1, height = 1, fixedsize=true];
        s0 -> s0 [label="a -> x = x.a\ny = y.a"];
        s0 -> s1 [label="a -> x = x.a\ny = y.a"];
        s1 -> s0 [label="a -> x = x.a\ny = y.a"];
        s1 -> s1 [label="a -> x = x.a\ny = y.a"];
        };
        

        输出是:

        有更好的渲染方式吗?

        【讨论】:

          猜你喜欢
          • 2011-11-08
          • 2011-09-07
          • 1970-01-01
          • 1970-01-01
          • 2020-02-19
          • 1970-01-01
          • 1970-01-01
          • 2013-03-28
          • 1970-01-01
          相关资源
          最近更新 更多