3

I'm using the grViz function from the DiagrammeR package, and I have defined a graph. My problem is that each time I plot it, I get a different arrangement.

for example, you will get a different plot each time you run the codes below. Is there a way to change this behaviour? (i.e. freeze a graph)

 grViz(
  "digraph {

  node [shape=circle, style=filled, fillcolor=skyblue]
  1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20

  1->2; 2->{3 4}; 3->4;
  5->6; 6->7
  8->{9 10 11}; 10->{9 11 12}; 11->12
  13->{14 15}
  16->{17 18 19}; 19->{18 20}
  4->5; 5->8; 11->13; 13->16

  }",engine="neato"
)

Thanks

Ajay Ohri
  • 3,382
  • 3
  • 30
  • 60
Mostafa Rezaei
  • 599
  • 5
  • 9

1 Answers1

0

it is the same graph in terms of nodes and edges, it is just rotated, the relationships remain the same

enter image description here enter image description here enter image description here

Ajay Ohri
  • 3,382
  • 3
  • 30
  • 60
  • you're right that the structure is the same, but the relative positions change. This is important to me since I was going to use it for presentation purposes. – Mostafa Rezaei Jul 04 '15 at 07:41