Help with absolute positioning

Hi guys, hoping anyone can help me here:

I want to use graphviz to display a simple graph with one node. The position of the node P1 should be defined via the pos attribute.

But somehow, the node is always drawn in the middle of the graph instead at the given coordinates.

digraph G { compound=true; bgcolor="lightgrey"; size="9,9";
"P1" [ pos="5,4!"]; }

I use neato: dot.exe -Kneato -n myInput.txt -Tsvg > outfile.svg

Thanks in advance

Thank you very much !

Thank you very much !

The Graphviz layout programs

The Graphviz layout programs basically are set up to make the drawing just big enough. The size attribute causes the layout to be scaled to fit. A similar situation holds with the page parameter.

The easiest way to get what you want is to put an invisible cluster around your node of the size you want. Also, note that when you use neato -n, coordinate should be in points. And neato -n makes the use of ! in pos unnecessary.


digraph G { 
  subgraph cluster0 {
  "P1" [ pos="360,288"]; 


works perfectly, thank you

works perfectly, thank you very much !

Recent comments