LB40
LB40

Reputation: 12341

Star-shaped graph in dot?

Ḧi,

I'd like to draw a graph using the dot language that looks like a star ( a central node, wih all the other nodes with one link to this other node).

I've been googling around without finding much. Do you have a basic example ?

thanks

Upvotes: 3

Views: 2390

Answers (2)

Joma sim
Joma sim

Reputation: 218

use this example

    graph g {

    node1 [label="1"]
    node2 [label="2"]
    node3 [label="3"]
    node4 [label="4"]
    node5 [label="5"]
    node6 [label="6"]
    node7 [label="7"]

   node4 -- node3
   node4 -- node2 
   node4 -- node1
   node4 -- node5
   node4 -- node7
   node4 -- node6

   }

Then invoke this commmand: neato -T svg -o direct.svg direct.dot

output as shown:

image description

Upvotes: 1

Aaron Digulla
Aaron Digulla

Reputation: 328770

Try twopi as the layouter and select radial layout.

Upvotes: 4

Related Questions