Different nodes sizes in png, same attributes in dot?

The dot attributes are the same:

strict digraph G {

forcelabels=false
ratio=fill
splines=spline
overlap=scale
size="1.3,1.3"

node [shape=circle,
      fixedsize=true,
      width=6,
      label="",
      color="black",
      fillcolor="#6666ee",
      style="filled,solid"]

The .png files show different node sizes:
_e0_1
Sorry, I am not able to upgrade the other .png since I am a new user!

What may be the reason?

[I’m confused, but I’m often confused, so I’m used to it.]
I see 5 small purple-ish circles that are arguably the same size. Let me ask some questions:

  • what version of dot are you using? run dot -V
  • what OS are you using (Linux, WIndows, MacOS, …)?
  • how different are the node sizes - 1 or 2 percent, 50 percent, …
  • what program(s) do you use to look at the .png files - MS paint, gimp, a web browser, ??
  • Have you tried producing a different file format (svg, jpeg, gif, …) If so, were the sizes different?
  • will you include your entire input file, the source above is incomplete

I see 5 small purple-ish circles that are arguably the same size.
Yes, there are two .dot files, one with five circles symmetrically arranged, the other with six circles symmetrically arranged too. The difference in the nodes sizes is only between the outputs, although in both dot files the default width attribute is 6, but in fact this attribute does not seem to have an effect on the circle size. I will put the files on the end of this reply, if the forum allows me to do so.
Let me ask some questions:

what version of dot are you using? run dot -V
dot - graphviz version 2.43.0 (0)
what OS are you using (Linux, WIndows, MacOS, …)?
Linux Mint 20
how different are the node sizes - 1 or 2 percent, 50 percent, …
the circles for the 6 nodes graph are twice as big
what program(s) do you use to look at the .png files - MS paint, gimp, a web browser, ??
Xviewer 2.6.2
Have you tried producing a different file format (svg, jpeg, gif, …) If so, were the sizes different?
No, I did not. The pngs are processed further (with LaTeX), so the visual size is not changed by this. Also adding edges to the dot input has no effect on the circles sizes.
will you include your entire input file, the source above is incomplete

5 nodes (there are additional invisible nodes with width=0.0)

strict digraph G {

forcelabels=false
ratio=fill
splines=spline
overlap=scale
size="1.3,1.3"

node [shape=circle,
      fixedsize=true,
      width=6,
      label="",
      color="black",
      fillcolor="#6666ee",
      style="filled,solid"]

edge [arrowsize=15,
      penwidth=5]

      1 [pos="0,8.1!"];
      2 [pos="-9.9,1.1438!"];
      4 [pos="-5.5356,-8.6!"];
      5 [pos="5.5356,-8.6!"];
      3 [pos="9.9,1.1438!"];
      t1_2 [width=0.0,pos="-8.8,1.9167!"];
      t2_1 [width=0.0,pos="-1.1,7.327!"];
      t1_3 [width=0.0,pos="8.8,1.9167!"];
      t3_1 [width=0.0,pos="1.1,7.327!"];
      t2_4 [width=0.0,pos="-6.02,-7.5173!"];
      t4_2 [width=0.0,pos="-9.415,0.0612!"];
      t3_5 [width=0.0,pos="6.02,-7.5173!"];
      t5_3 [width=0.0,pos="9.415,0.0612!"];
      t4_5 [width=0.0,pos="4.3055,-8.6!"];
      t5_4 [width=0.0,pos="-4.3055,-8.6!"];
      t1_4 [width=0.0,pos="-4.9205,-6.7445!"];
      t4_1 [width=0.0,pos="-0.615,6.2445!"];
      t1_5 [width=0.0,pos="4.9205,-6.7445!"];
      t5_1 [width=0.0,pos="0.615,6.2445!"];
      t2_3 [width=0.0,pos="7.7,1.1438!"];
      t3_2 [width=0.0,pos="-7.7,1.1438!"];
      t4_3 [width=0.0,pos="8.185,0.0612!"];
      t3_4 [width=0.0,pos="-3.8205,-7.5174!"];
      t5_2 [width=0.0,pos="-8.185,0.0612!"];
      t2_5 [width=0.0,pos="3.8205,-7.5174!"];
}

6 nodes (there are additional invisible nodes with width=0.0)

strict digraph G {

forcelabels=false
ratio=fill
splines=spline
overlap=scale
size="1.3,1.3"

node [shape=circle,
      fixedsize=true,
      width=6,
      label="",
      color="black",
      fillcolor="#6666ee",
      style="filled,solid"]

edge [arrowsize=10,
      penwidth=5]

      1 [pos="0,9!"];
      2 [pos="-7.7942,4.5!"];
      3 [pos="7.7942,4.5!"];
      4 [pos="-7.7942,-4.5!"];
      5 [pos="7.7942,-4.5!"];
      6 [pos="0,-9!"];
      t1_6 [width=0.0,pos="0,-6.75!"];
      t6_1 [width=0.0,pos="0,6.75!"];
      t1_2 [width=0.0,pos="-5.8457,5.625!"];
      t2_1 [width=0.0,pos="-1.9486,7.875!"];
      t1_3 [width=0.0,pos="5.8457,5.625!"];
      t3_1 [width=0.0,pos="1.9486,7.875!"];
      t2_4 [width=0.0,pos="-7.7942,-2.25!"];
      t4_2 [width=0.0,pos="-7.7942,2.25!"];
      t3_5 [width=0.0,pos="7.7942,-2.25!"];
      t5_3 [width=0.0,pos="7.7942,2.25!"];
      t6_4 [width=0.0,pos="-5.8457,-5.625!"];
      t4_6 [width=0.0,pos="-1.9486,-7.875!"];
      t6_5 [width=0.0,pos="5.8457,-5.625!"];
      t5_6 [width=0.0,pos="1.9486,-7.875!"];
      t2_3 [width=0.0,pos="5.8457,4.5!"];
      t3_2 [width=0.0,pos="-5.8457,4.5!"];
      t4_5 [width=0.0,pos="5.8457,-4.5!"];
      t5_4 [width=0.0,pos="-5.8457,-4.5!"];
      t4_3 [width=0.0,pos="5.8457,3.375!"];
      t3_4 [width=0.0,pos="-5.8457,-3.375!"];
      t5_2 [width=0.0,pos="-5.8457,3.375!"];
      t2_5 [width=0.0,pos="5.8457,-3.375!"];
      t1_4 [width=0.0,pos="-6.82,-2.8125!"];
      t4_1 [width=0.0,pos="-0.9743,7.3125!"];
      t1_5 [width=0.0,pos="6.82,-2.8125!"];
      t5_1 [width=0.0,pos="0.9743,7.3125!"];
      t6_2 [width=0.0,pos="-6.82,2.8125!"];
      t2_6 [width=0.0,pos="-0.9743,-7.3125!"];
      t6_3 [width=0.0,pos="6.82,2.8125!"];
      t3_6 [width=0.0,pos="0.9743,-7.3125!"];
}

I think image scaling is causing the node size issues.

  • node width is set to 6. This is 6 inches, not points! Try width=.1 (or so) (This bites me regularly too)
  • if you need the size attribute, try adding a !. size="1.3,1.3!"
  • I’m not sure you need the ratio attribute. Note that it affects scaling
  • I don’t think you need the overlap attribute. note that it causes scaling also

I think the image scaling as the reason too. But I miss a true control of it. It seems to me somewhat arbitrary. I checked the topics you proposed. Nothing was helping! The ratio attribute seems to me to be necessary, as I want to integrate the resulting pngs in a LaTeX table. I could find out, that a node width value 0.3 results in very tiny circles, so I kept a big value supposedly meaning, that any maximum size is used. But I did not find anything about such a maximum size. In contrast I found a strange effect not justifiable by the graph layout: In fact removing all the 0.0-width nodes in the 5-nodes graph effected, that the nodes appeared (nearly) as big as within the 6-nodes graph. But adding only one node “t4_5 [width=0.0,pos=“4.3055,-8.6!”];” again led to the smaller size. Note, that t4_5 lies between the visible nodes 4 and 5.

For unknown reasons, neato was messing with your pinned layout. Here are reworked versions that seem close to your goal.
Note: use neato -n or neato -n2 to produce your output

    strict digraph G {
            // use this command:   neato -n2 -T...
            // pos values were multiplied by 5
    	// widths are guesses
    	graph [bb="-60,-60,60,60"];  // generated manually
    	node [color=black,
    		fillcolor="#6666ee",
    		fixedsize=true,
    		label="",
    		shape=circle,
    		style="filled,solid"
    	];
    	// p1 and p2 exist to guarantee squareness - same X & Y dimensions	
    	p1	[pos="-55.000000,-55.000000",
    		shape=point,
    		width=.01,
    		style=invis];
    	p2	[pos="55.000000,55.000000",
    		shape=point,
    		width=.01,
    		style=invis];
    	1	[pos="0.000000,40.500000",
    		width=.1];
    	2	[pos="-49.500000,5.719000",
    		width=.1];
    	4	[pos="-27.678000,-43.000000",
    		width=.1];
    	5	[pos="27.678000,-43.000000",
    		width=.1];
    	3	[pos="49.500000,5.719000",
    		width=.1];

    	node[width=.05]
    	t1_2	[pos="-44.000000,9.583500"];
    	t2_1	[pos="-5.500000,36.635000"];
    	t1_3	[pos="44.000000,9.583500"];
    	t3_1	[pos="5.500000,36.635000"];
    	t2_4	[pos="-30.100000,-37.586500"];
    	t4_2	[pos="-47.075000,0.306000"];
    	t3_5	[pos="30.100000,-37.586500"];
    	t5_3	[pos="47.075000,0.306000"];
    	t4_5	[pos="21.527500,-43.000000"];
    	t5_4	[pos="-21.527500,-43.000000"];
    	t1_4	[pos="-24.602500,-33.722500"];
    	t4_1	[pos="-3.075000,31.222500"];
    	t1_5	[pos="24.602500,-33.722500"];
    	t5_1	[pos="3.075000,31.222500"];
    	t2_3	[pos="38.500000,5.719000"];
    	t3_2	[pos="-38.500000,5.719000"];
    	t4_3	[pos="40.925000,0.306000"];
    	t3_4	[pos="-19.102500,-37.587000"];
    	t5_2	[pos="-40.925000,0.306000"];
    	t2_5	[pos="19.102500,-37.587000"];
    }

And

        strict digraph G {
                // use this command:   neato -n2 -T...
                // pos values were multiplied by 5
        	// widths are guesses
        	graph [bb="-60,-60,60,60"];  // generated manually
        	node [color=black,
        		fillcolor="#6666ee",
        		fixedsize=true,
        		label="",
        		shape=circle,
        		style="filled,solid"
        	];
        	// p1 and p2 exist to guarantee squareness - same X & Y dimensions
        	p1	[pos="-55.000000,-55.000000",
        		shape=point,
        		width=.01,
        		style=invis];
        	p2	[pos="55.000000,55.000000",
        		shape=point,
        		width=.01,
        		style=invis];
        	1	[pos="0.000000,45.000000",
        		width=.1];
        	2	[pos="-38.971000,22.500000",
        		width=.1];
        	3	[pos="38.971000,22.500000",
        		width=.1];
        	4	[pos="-38.971000,-22.500000",
        		width=.1];
        	5	[pos="38.971000,-22.500000",
        		width=.1];
        	6	[pos="0.000000,-45.000000",
        		width=.1];
        		
        	node[width=.05]
        	t1_6	[pos="0.000000,-33.750000"];
        	t6_1	[pos="0.000000,33.750000"];
        	t1_2	[pos="-29.228500,28.125000"];
        	t2_1	[pos="-9.743000,39.375000"];
        	t1_3	[pos="29.228500,28.125000"];
        	t3_1	[pos="9.743000,39.375000"];
        	t2_4	[pos="-38.971000,-11.250000"];
        	t4_2	[pos="-38.971000,11.250000"];
        	t3_5	[pos="38.971000,-11.250000"];
        	t5_3	[pos="38.971000,11.250000"];
        	t6_4	[pos="-29.228500,-28.125000"];
        	t4_6	[pos="-9.743000,-39.375000"];
        	t6_5	[pos="29.228500,-28.125000"];
        	t5_6	[pos="9.743000,-39.375000"];
        	t2_3	[pos="29.228500,22.500000"];
        	t3_2	[pos="-29.228500,22.500000"];
        	t4_5	[pos="29.228500,-22.500000"];
        	t5_4	[pos="-29.228500,-22.500000"];
        	t4_3	[pos="29.228500,16.875000"];
        	t3_4	[pos="-29.228500,-16.875000"];
        	t5_2	[pos="-29.228500,16.875000"];
        	t2_5	[pos="29.228500,-16.875000"];
        	t1_4	[pos="-34.100000,-14.062500"];
        	t4_1	[pos="-4.871500,36.562500"];
        	t1_5	[pos="34.100000,-14.062500"];
        	t5_1	[pos="4.871500,36.562500"];
        	t6_2	[pos="-34.100000,14.062500"];
        	t2_6	[pos="-4.871500,-36.562500"];
        	t6_3	[pos="34.100000,14.062500"];
        	t3_6	[pos="4.871500,-36.562500"];
        }

fiveNodes1
sixNodes1

We could possibly introduce a notation for units, e.g. width= “6pt”, width=“0.5 in” maybe the same year that a space colony is established on Mars.

I could not reproduce your results. The 5 (big) nodes example looks for me as: ???(I do not know how to include png! The nodes with different sizes are located arbitrarily! The same with your second example.) I am wondering, why you did not use the exclamation mark to force the positioning, but an attempt on my part in this direction resulted in an image showing no nodes at all.
I made also further trials on the base of my dot files: I added corner points, as you did. I added a bb attribute to the graph. I used neato with -n and with -n2. No one of them had an effect on the strange behavior I described. After adding the zero-sized node t4_5 the nodes 1…5 are only half as big. Btw I do not have this effect with adding t2_3.

  • to include an image (png), use the “mountain-within-a-square” icon that is just to the right of the icon that looks like this: </> (see below)
  • no guesses yet why we’re getting different results
  • What version of Graphviz are you using? (dot -V)
  • What OS are you using (Windows, Linux, …)?
  • please show your command line (yes, I am grasping at straws)
  • I am not pinning the nodes individually (with !) because neato -n and neato -n2 treat every object (node or edge) with a pos attribute as pinned (FAQ and FAQ)
  • neato -n2 is only needed if you add edges

b0.steveroush1
Here my result for your first example.

b0.steveroush2
… and here for the second one.

Platform and graphviz version always as mentioned above.
My command line: neato -Kfdp -n -Tpng -o steveroush1.png steveroush1.dot

ok, I see: -Kfdp was messing up the nodes! Omiting it produces your image.

… but I have another issue with neato -n and neato -n2 now:
4n3e
I want straight arrows, even they are laying one over the other. Here my dot file:

strict digraph G {

forcelabels=false
ratio=fill
splines=spline
overlap=scale
size="1.3,1.3"

node [shape=circle,
      fixedsize=true,
      width=0.15,
      label="",
      color="black",
      fillcolor="#8888ee",
      style="filled,solid"]

edge [arrowsize=0.5,
      penwidth=1]

      1 [pos="-9.9,9.9!"];
      2 [pos="-9.9,-9.9!"];
      3 [pos="9.9,9.9!"];
      4 [pos="9.9,-9.9!"];
      t1_2 [width=0.0,style=invis,pos="-9.9,-4.4!"];
      t2_1 [width=0.0,style=invis,pos="-9.9,4.4!"];
      t1_3 [width=0.0,style=invis,pos="4.4,9.9!"];
      t3_1 [width=0.0,style=invis,pos="-4.4,9.9!"];
      t1_4 [width=0.0,style=invis,pos="4.4,-4.4!"];
      t4_1 [width=0.0,style=invis,pos="-4.4,4.4!"];
      t2_3 [width=0.0,style=invis,pos="4.4,4.4!"];
      t3_2 [width=0.0,style=invis,pos="-4.4,-4.4!"];
      t2_4 [width=0.0,style=invis,pos="4.4,-9.9!"];
      t4_2 [width=0.0,style=invis,pos="-4.4,-9.9!"];
      t3_4 [width=0.0,style=invis,pos="9.9,-4.4!"];
      t4_3 [width=0.0,style=invis,pos="9.9,4.4!"];
      1 -> t1_2
      t1_2 -> 2 [dir="none"]
      2 -> t2_1
      t2_1 -> 1 [dir="none"]
      2 -> t2_3
      t2_3 -> 3 [dir="none"]
}

The original graph generated with dot -Kfdp was, as in the next reply. (Silly restriction!)

Can you give me a hint, how I can generate it with neato?

Here:
m4n3e_x

splines=false (Node, Edge and Graph Attributes) will probably do what you want.
Note that your pos values are legal but may cause problems (pixelation?). You graph is defined as ~.27"x.27". (pos units are points - 72 per inch)

Yes, splines=false yields, what I want. As I observe, the pos values are scaling with the size value. But a white margin is disturbing me.
4n3e
How can I control it?

margin Node, Edge and Graph Attributes ?

I tried margin=0.0 on graph level without an effect. I am not aware about the defaults on nodes and edges. Here my dot file:

strict digraph G {
forcelabels=false
ratio=fill
splines=false
overlap=scale
size="1.56,1.56!"
margin=0.0

node [shape=circle,
      fixedsize=true,
      width=0.20,
      label="",
      color="black",
      fillcolor="#8888ee",
      style="filled,solid"]

edge [arrowsize=0.7,
      penwidth=1.5]

      1 [pos="-9.9,9.9!"];
      2 [pos="-9.9,-9.9!"];
      3 [pos="9.9,9.9!"];
      4 [pos="9.9,-9.9!"];
      t1_2 [width=0.0,style=invis,pos="-9.9,-4.4!"];
      t2_1 [width=0.0,style=invis,pos="-9.9,4.4!"];
      t1_3 [width=0.0,style=invis,pos="4.4,9.9!"];
      t3_1 [width=0.0,style=invis,pos="-4.4,9.9!"];
      t1_4 [width=0.0,style=invis,pos="4.4,-4.4!"];
      t4_1 [width=0.0,style=invis,pos="-4.4,4.4!"];
      t2_3 [width=0.0,style=invis,pos="4.4,4.4!"];
      t3_2 [width=0.0,style=invis,pos="-4.4,-4.4!"];
      t2_4 [width=0.0,style=invis,pos="4.4,-9.9!"];
      t4_2 [width=0.0,style=invis,pos="-4.4,-9.9!"];
      t3_4 [width=0.0,style=invis,pos="9.9,-4.4!"];
      t4_3 [width=0.0,style=invis,pos="9.9,4.4!"];
      1 -> t1_2
      t1_2 -> 2 [dir="none"]
      2 -> t2_1
      t2_1 -> 1 [dir="none"]
      2 -> t2_3
      t2_3 -> 3 [dir="none"]
}

Ad my post from May 11: The node size is dependent from the distance of t4_5 from 5. Moving t4_5 a little further away from 5 lets get the nodes bigger, but not as big as they are in my 6 nodes example. It seems this is an effect of overlap=scale.