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

1

7

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?

Dermatoid answered 12/6, 2018 at 17:36 Comment(0)
D
14

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

}
Dermatoid answered 14/6, 2018 at 13:51 Comment(1)
height=0,width=0 (without the decimal points) gives the same result for me (i.e. without the blank)Digitalism

© 2022 - 2024 — McMap. All rights reserved.