如何在graphviz中隐藏节点边界?

问题描述 投票:4回答:2

我正在用graphviz绘制图形。即使我有节点的penwidth=0,我仍然看到节点边界。如何摆脱节点边界?

我在dot中的注释是这样的:

strict graph  {
    graph [bgcolor=white];
    0    [fillcolor=red,
        style=filled,
        shape=octagon,
        penwidht=0,
        fontsize=10,
        fixedsize=True,
        width=0.5,
        height=0.5,
        type=3];
    2    [shape=octagon,
        style=filled,
        fillcolor=gray,
        penwidth=0];
    0 -- 2  [penwidth=0.5,
        color=gray];
}
graphviz dot graph-visualization
2个回答
4
投票

这对我有用:

node [shape=plaintext]

资料来源:https://renenyffenegger.ch/notes/tools/Graphviz/examples/index


1
投票

setlinewidth对我有用:

strict graph  {
    graph [bgcolor=white];
    0    [fillcolor=red,
        style="filled,setlinewidth(0)",
        shape=octagon,
    penwidht=0,
        fontsize=10,
        fixedsize=True,
        width=0.5,
        height=0.5,
        type=3];
    2    [shape=octagon,
        style=filled,
        fillcolor=gray,
        penwidth=0];
    0 -- 2  [penwidth=0.5,
        color=gray];
}

0
投票

问题是你有一个错字。

penwidht应该是penwidth

strict graph  {
    graph [bgcolor=white];
    0    [fillcolor=red,
        style=filled,
        shape=octagon,
        penwidth=0,
        fontsize=10,
        fixedsize=True,
        width=0.5,
        height=0.5,
        type=3];
    2    [shape=octagon,
        style=filled,
        fillcolor=gray,
        penwidth=0];
    0 -- 2  [penwidth=0.5,
        color=gray];
}
© www.soinside.com 2019 - 2024. All rights reserved.