Node with both text and image?

It seems like the answer is “no,” but I figured I’d ask:
Is it possible to put an image in a node after some text?

I’m using html-style labels, so I tried using an html image tag, but that didn’t work. I tried having a label and an image, and that superimposed the two. It’s not critical that I have the text/image thing, so don’t bother testing complex workarounds for me (unless that’s your thing).

Two cells within an html-label - one with the text and the other containing the image. You can eliminate the line separating the cells by using the sides attribute (Node Shapes | Graphviz)

You can do it with nodes. The node must be larger than the image. Use the labelloc attribute to align the label text to the top or bottom of the node, and use the imagepos attribute to align the image to the opposite side of the node. Depending on your image, you may also need to set the imagescale attribute to keep the image from scaling up to fill the node.

Shameless plug, Excel to Graphviz (my baby) has a style designer worksheet and clickable menu. Images and imagepos are supported on the far right of the tab menu. You can click shapes, sizes, and other attributes and with each click see how Graphviz renders it. The string of attributes is then displayed.

1 Like