How to resize an image node?

Without using HTML, what is an easy way to resize external images used in a GraphViz document? For example, with the following:

somenode [size=1 image="littleperson.png", label=""]; 

How can I reduce the image? [Preferably without HTML, using HTML if it is most directly or inevitably.]

I'm not very lucky with HTML:

 somenode [label=<<IMG SRC="littleperson.png" />>]; 

Throws an error.

+6
source share
1 answer

You can make external images in several ways.

  • Without HTML, using the imagescale attribute and / or the fixedsize attribute along with the node weight and height attributes.

    somenode [width=50 height=50 fixedsize=true image="littleperson.png", label=""];

  • With HTML (the img HTML tag accepts the scale attribute, which has the same parameters as the image), the attributes for fixedsize and height and width refer to the td that contains the image tag.

    somenode [label=< <table><tr><td fixedsize="true" width="50" height="50"><img src="littleperson.png" /></td></tr></table> >];

  • Resize the image in an external program and load it

    somenode [image="littleperson_resized.png", label=""];

Additional Documentation / Links

+10
source

Source: https://habr.com/ru/post/980265/


All Articles