4

Please does anyone know if there's a way to make Graphviz's dot program (note: not neato, although I'd also be somewhat interested in answers for that) auto-fit the width of nodes to accommodate the labels I specify? At the moment I have this

digraph
{
    node [shape=record];
    n [label="This is a very long caption"];
}

but the node ends up too small to accommodate the caption:

Bad Graphviz output

I found an option called fixedsize, which in theory I should be able to set to false in order to make the nodes expand to fit their labels:

http://www.graphviz.org/doc/info/attrs.html#d:fixedsize

Unfortunately, it doesn't work, as this gives me the same result:

digraph
{
    node [shape=record, fixedsize=false];
    n [label="This is a very long caption"];
}

Any ideas please?

4

1 回答 1

2

您的示例中的节点标签宽度实际上在使用dot.

fixedsize=false(默认)如果输出格式是点则任何给定的值都应该产生给定的宽度值:width

另请注意,如果输出格式为点,则赋予宽度的值将是最终值。

您的 graphviz 版本可能存在问题 - 您是否尝试使用最新版本?

于 2012-04-09T19:47:06.197 回答