Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use Graphviz to draw a node pointed by an arrow?

Tags:

plot

graphviz

dot

I use dot language to draw a simple graph which contains only one node and an edge point to this node. I came up with a way to do so:

digraph dot {

    n0 [label= "", shape=none]

    n0 -> n1

}

enter image description here

This implementation create a blank in the top of graph. So how to remove this blank? In other words, are there any better implementation?

like image 865
sirius Avatar asked Jan 27 '23 22:01

sirius


1 Answers

I came up with another better solution, which is setting the "none" node to a point. Hope you guys provide a more elegant way.

digraph dot {

    n0 [label= "", shape=none,height=.0,width=.0]

    n0 -> n1

}
like image 88
sirius Avatar answered Feb 11 '23 09:02

sirius