Graphviz压缩图
我正在用graphviz和它提供的Graphviz压缩图,graphviz,circos,Graphviz,Circos,我正在用graphviz和它提供的circo工具生成一个图形 生成的图形是一个很好的形状,但是节点之间的边的长度比需要的大得多,这使得节点的文本很小(相对于输出图像),因此很难读取 如何使输出图像中的节点更大(相对),以便节点内的文本更易于阅读 输出图像: 源图形文件: digraph G { FoundUrlToFollow [shape=box]; "Fetch the URL" [shape=circle]; FoundUrlToFollow -> "Fet
circo
工具生成一个图形
生成的图形是一个很好的形状,但是节点之间的边的长度比需要的大得多,这使得节点的文本很小(相对于输出图像),因此很难读取
如何使输出图像中的节点更大(相对),以便节点内的文本更易于阅读
输出图像:
源图形文件:
digraph G {
FoundUrlToFollow [shape=box];
"Fetch the URL" [shape=circle];
FoundUrlToFollow -> "Fetch the URL";
ResponseReceived [shape=box];
"Fetch the URL" [shape=circle, label=<Fetch the URL>];
"Fetch the URL" -> ResponseReceived;
ResponseError [shape=box];
"Fetch the URL" [shape=circle, label=<Fetch the URL>];
"Fetch the URL" -> ResponseError;
ResponseReceived [shape=box];
"Log response" [shape=circle];
ResponseReceived -> "Log response";
ResponseReceived [shape=box];
"Is the response OK?" [shape=circle];
ResponseReceived -> "Is the response OK?";
ResponseOk [shape=box];
"Is the response OK?" [shape=circle, label=<Is the response<br/>OK?>];
"Is the response OK?" -> ResponseOk;
ResponseOk [shape=box];
"Is the response HTML?" [shape=circle];
ResponseOk -> "Is the response HTML?";
HtmlToParse [shape=box];
"Is the response HTML?" [shape=circle, label=<Is the response<br/>HTML?>];
"Is the response HTML?" -> HtmlToParse;
HtmlToParse [shape=box];
"Parse the HTML to find links" [shape=circle];
HtmlToParse -> "Parse the HTML to find links";
FoundUrl [shape=box];
"Parse the HTML to find links" [shape=circle, label=<Parse the HTML<br/>to find links>];
"Parse the HTML to find links" -> FoundUrl;
FoundUrl [shape=box];
"Should we follow this URL?" [shape=circle];
FoundUrl -> "Should we follow this URL?";
FoundUrlToSkip [shape=box];
"Should we follow this URL?" [shape=circle, label=<Should we<br/>follow this<br/>URL?>];
"Should we follow this URL?" -> FoundUrlToSkip;
FoundUrlToFollow [shape=box];
"Should we follow this URL?" [shape=circle, label=<Should we<br/>follow this<br/>URL?>];
"Should we follow this URL?" -> FoundUrlToFollow;
FoundUrlToSkip [shape=box];
"Log skipped links" [shape=circle];
FoundUrlToSkip -> "Log skipped links";
graph [label="Switches are circles. Events are boxes.", fontsize="12", overlap=scale];
edge [splines=curved];
}
我会尝试在图表中添加mindist(小于1):
graph [..., overlap=scale, mindist=.6];
[编辑]
也许渲染器版本会有所不同:下面是我的机器上的结果
尝试改变
-Gsize
(英寸单位)和-Gdpi
。您会发现,如果同时更改它们,您将获得具有相同像素大小的不同输出,但节点之间的间距相对于节点本身的大小不同-Gnodesep
和-Nfontsize
也可能有助于调整。通过将其渲染为EPS、PDF或SVG,然后将其转换为PNG,而不是使用Graphviz的PNG渲染器,您可能会有更好的运气。根据我的经验,从Graphviz获得令人满意的输出是一门非常不精确的科学。这似乎没有多大区别——不同的一点是,我显然没有在libexpat中编译,因此HTML是在一行上呈现的。这与fontsize的结合似乎对定位有很大的改变。你说得对。可能会根据节点按比例缩放边。一般来说,我正在从Graphviz(在我花了时间之后)切换到OGDF,因为根据需要“混合”布局并不容易。。。
graph [..., overlap=scale, mindist=.6];