Search code examples
plotgraphvizdot

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


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?


Solution

  • 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
    
    }