4

我是 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";
}

谢谢,

阿莱西奥

4

1 回答 1

8

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

应用了 rankep 的 twopi 输出

于 2012-12-06T20:35:56.560 回答