Images within nodes (scaling etc)

Sorry if this message shows up somewhere else. I'm having a little trouble following the clues found here: http://www.graphviz.org/content/images-nodes-label-below Whose attribute is the fixedsize? The node or the TD? The closest I have gotten so far to joy is by:

<code>

digraph structs {

     struct1 [margin=0 shape=box, style=filled, fillcolor=white, color=blue, label=<<TABLE border="0" cellborder="0">
                       <TR><TD width="60" height="50" fixedsize="true"><IMG SRC="g0.png" scale="true"/>
                           </TD><td><font point-size="10">protein2ppw</font></td></TR>
              </TABLE>>];

     struct2 [margin=0 shape=box, style=filled, fillcolor=white, color=red, label=<<TABLE border="0" cellborder="0">
                       <TR><TD width="60" height="50" fixedsize="true"><IMG SRC="g0.png" scale="true"/></TD>
                       <td><font point-size="10">[email protected]</font></td></TR>
              </TABLE>>];

     struct3 [margin=0 shape=box, style=filled, fillcolor=white, color=green, label=<<TABLE border="0" cellborder="0">
                       <TR><TD width="60" height="50" fixedsize="true"><IMG SRC="g0.png" scale="true"/></TD>
                       <td><font point-size="10">[email protected]</font></td></TR>
              </TABLE>>];

    struct1 -> struct2;
    struct1 -> struct3 ;

}

 

</code>

which produces the attached image, but also a lot of complaining:

<pre>

dot -Tpng stable.dot -o stable.png
Warning: node 'struct1', graph 'structs' size too small for label
Warning: node 'struct2', graph 'structs' size too small for label
Warning: node 'struct3', graph 'structs' size too small for label

</pre>

AttachmentSize
stable.png15.86 KB

If you put the fixedsize

If you put the fixedsize attribute inside <TD>, it applies to the cell. If you make it part of a node's attribute, it applies to the node. The warning just indicates that the size of the image, plus the default 2 points of padding, is larger than the specified 60x50 points of the fixed size. Note that, in this case, the image is uniformly scaled down to fit the cell size. Hence, your nodes look good to me. If you feel there is something wrong, let us know.

I like the look of the nodes,

I like the look of the nodes, it was the complaining that made me wonder.

Can I suppress the complaining? It will not doubt scare my users.

If you are running from the

If you are running from the command line, use -q to turn off warnings. If you are using a library interface, use the agseterr() function. In the latter case, you can also arrange to get all messages sent to a function provided by you.

Recent comments