When you have graphs with a significant edgewidth.
for instance:
digraph {
A -> B [penwidth=10]
}
It seems like the fill of the arrow-head aligns with the fill of the nodes shape, i.e. the stroke or border of the arrow overlaps significantly with the node…
Is there a way to counteract this behavior, e.g. using a do-not-overlap setting or manually adding an offset between the arrowhead and the node.
Yep, looks like a bug to me. You get the same result with png and svg. I’m surprised this hasn’t been reported before.
The only work-around I found was this:
dot -T dot yourfile.gv >yourfile.dot
edit all the pos values for edges with penwidth>1 (see Attributes | Graphviz and example below)
Note that this happens to me even with the most simple of graphs, with the default settings. E.g. see this graph and its PDF output.
digraph {
a -> b;
}
I personally find it a real eye sore. Another eye sore is that the label of a vertically straight edge touches the edge. Both problems visible in the image below.
Hi, starting to work on my slides for teaching graph theory. I was really happy to work with Graphviz for one day until I started creating my first directed graph…
Thus bug is really a no-go for me. I use penwidth=1.75 for the edges and the nodes, nothing too much for slides.
Since I work with EPS output, I manually edited the resulting file and noticed I could get acceptable display by leaving 1.75 setlinewidth for the edge (as initially wanted) but setting something like 0.5 setlinewidth for the arrow.
Wouldn’t it be possible to add a new attribute for EPS (and maybe SVG) in order to get two different penwidth (one for the edge and one for the arrow)?
The setlinewidth style value can be used for more control over the width of node borders and
edges than is allowed by bold. This style value takes an argument, specifying the width of the
line in points. For example, style="bold" is equivalent to style="setlinewidth(2)". The use of
setlinewidth is deprecated; one should use the penwidth attribute instead.
It looks like @magjac has made major improvements to this bug (see below).
What version of Graphviz are you using - dot -V. Maybe time to download a new version.