Graphviz/Dot - 如何用独特的颜色标记树上的所有叶子?
我有一个将图形打印为 .dot 文件的脚本。我想用不同的颜色突出显示不同程度的所有顶点。 Graphviz 可以吗?
所以,我对以下内容感兴趣:
For each i-degree vertex use color[i].
作为一种特殊情况,如何用独特的颜色标记树中的所有叶子? :
For each 1-degree vertex use color_A.
I have a script which prints a graph as .dot file. I would like to highlight all vertices of different degree with distinctive colors. Is it possible with Graphviz?
So, I am interested in the following:
For each i-degree vertex use color[i].
and as a special case, how to mark all leaves in a tree with a distinctive color? :
For each 1-degree vertex use color_A.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 graphviz 实用程序 gvpr 来编写图形脚本。
特别是,
gvpr -c 'N[level==1]{color="red"}'
您可以增强它来定义数组(或关联映射)并查找 color[$. Degree]
Stephen North
Try the graphviz utility gvpr for writing graph scripts.
In particular,
gvpr -c 'N[degree==1]{color="red"}'
You can enhance this to define an array (or associative map) and look up color[$.degree]
Stephen North