控制间距在twopi(Graphviz)

时间:2012-12-06 18:12:25

标签: graphviz

我是Graphviz的新手,我正在尝试绘制一个以实体为中心的树(我正在使用twopi命令)。

  • 如果我将overlap=true重叠,即使它有很多空间,也会重叠标签。
  • 如果我放overlap=false,标签会变得太小。

如何在没有重叠的情况下获得第一种情况?

完整代码:

digraph g {
    graph [ fontname = "Helvetica",
        fontsize = 10,
        size = "500,500",
        splines=true,
        overlap=false,
        ratio=.5 ];
    node [  shape = plaintext,
        fontname = "Helvetica" ];

    root="owl:Thing";
    "owl:Thing" -> "Work";
    "Work" -> "WrittenWork";
    "Work" -> "Software";
    "Work" -> "Website";
    "Work" -> "Film";
    "owl:Thing" -> "Agent";
    "Agent" -> "Organisation";
    "Organisation" -> "Non-ProfitOrganisation";
    "Organisation" -> "GeopoliticalOrganisation";
    "Organisation" -> "SambaSchool";
    "Agent" -> "Person";
    "Person" -> "Athlete";
    "Person" -> "OfficeHolder";
    "Person" -> "Astronaut";
    "Person" -> "Philosopher";
    "Person" -> "Architect";
    "owl:Thing" -> "Drug";
    "owl:Thing" -> "Place";
    "Place" -> "SiteOfSpecialScientificInterest";
    "Place" -> "PopulatedPlace";
    "PopulatedPlace" -> "Country";
    "PopulatedPlace" -> "Continent";
    "PopulatedPlace" -> "Atoll";
    "Place" -> "ProtectedArea";
    "Place" -> "ArchitecturalStructure";
    "Place" -> "HistoricPlace";
    "Place" -> "NaturalPlace";
    "NaturalPlace" -> "Mountain";
    "NaturalPlace" -> "Volcano";
    "NaturalPlace" -> "MountainRange";
}

谢谢,

Alessio的

1 个答案:

答案 0 :(得分:8)

对于此特定图表,您可以使用overlap=true,然后递增ranksep,直到没有标签重叠为止。 ranksep=1.3似乎是一个很好的价值。

twopi output with ranksep applied