[英]Create node in graphviz using polygon as icon and text label
You can't easily embed nodes within other nodes, but you can insert images into nodes.您不能轻松地将节点嵌入到其他节点中,但您可以将图像插入到节点中。 Create an image (or images) with the polygon shape(s) and insert them into an HTML-style node (record-style would probably also work).创建具有多边形形状的图像(或图像)并将它们插入到 HTML 样式节点中(记录样式可能也可以工作)。
Like so:像这样:
digraph i{
{rank=same
n1 [shape=plaintext,label=<
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="1" cellborder="0">
<TR><TD FIXEDSIZE="true" height="20" width="20"><IMG SRC="cow.png" scale="true"/></TD><TD>some text</TD></TR>
</TABLE>
>
]
n2 [shape=plaintext,label=<
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="1" cellborder="0" >
<TR><TD colspan="2" bgcolor="green1">Step</TD></TR>
<TR><TD FIXEDSIZE="true" height="20" width="20"><IMG SRC="cow.png" scale="true"/></TD><TD>some text</TD></TR>
</TABLE>
>
]
n1 -> n2
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.