在twopi中控制间距(Graphviz) [英] Control spacing in twopi (Graphviz)

查看:230
本文介绍了在twopi中控制间距(Graphviz)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm a newbie with Graphviz, and I'm trying to draw a tree centered in an entity (I'm using the twopi command).

  • 如果我放置overlap=true,即使重叠标签周围有很多空间,它也会重叠.
  • 如果我放overlap=false,标签会变得太小.
  • If I put overlap=true it overlaps even if it has a lot of space aroud the overlapped labels.
  • If I put overlap=false, labels become too small.

在没有重叠的情况下,我如何能遇到第一种情况?

How can I have the first situation without overlapping?

完整代码:

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

推荐答案

对于此特定图形,可以使用overlap=true,然后递增ranksep,直到不再有标签重叠为止. ranksep=1.3似乎很有价值.

For this particular graph, you may use overlap=true and then increment ranksep until no labels overlap anymore. ranksep=1.3 seems to be a good value.

这篇关于在twopi中控制间距(Graphviz)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆