2

In this example, the edges don't connect to the vertex it comes from. I'm using tkz-graph, and use \tikzstyle{EdgeStyle}=[pos] to give an arrow head to the edges. I modified the value of \VertexInterMinSize and \VertexDistance, but it doesn't make the vertex slightly bigger so to touch the edge. Making the vertex bigger by modifying \VertexSmallMinSize doesn't work either.

\documentclass{standalone}
\usepackage{tkz-graph}

\begin{document}
    \begin{tikzpicture}
        \GraphInit[vstyle=Classic]
        \renewcommand*{\VertexInterMinSize}{1mm}
        \renewcommand*{\VertexDistance}{1mm}
        \renewcommand*{\VertexSmallMinSize}{1mm}
        
        \Vertex[x=-2,y=0,Lpos=90,style = {font=\footnotesize},L=a]{a}
        
        \Vertex[x=0,y=0,Lpos=90,style = {font=\footnotesize,align=center},L={b\\b}]{b}
        \Vertex[x=3,y=-1,Lpos=0,style = {font=\footnotesize},L=c]{c}
        \Vertex[x=0,y=-2,Lpos=-90,style = {font=\footnotesize},L=d]{d}
        \Vertex[x=3,y=-3,Lpos=-90,style = {font=\footnotesize},L=e]{e}
        
        \tikzstyle{EdgeStyle}=[post]
        \tikzset{LabelStyle/.style = {draw opacity=0, fill opacity=0, text opacity=1,font=\footnotesize}}
        \Edge[label=1, labelstyle={above}](b)(a)
        
        \Edge[label=2, labelstyle={above}](b)(c)
        \Edge[label=3, labelstyle={above,xshift=2mm}](b)(e)
        \Edge[label=4, labelstyle={left}](b)(d)
        \Edge[label=5, labelstyle={below,xshift=-2mm}](d)(e)
        \Edge[label=6, labelstyle={right}](c)(e)
    \end{tikzpicture}
\end{document}

1 Answer 1

1

Instead \tikzstyle{EdgeStyle}=[pos], I changed it to \tikzstyle{EdgeStyle}=[->], and now the edges connect to the out vertex.

1
  • 1
    The reason this works is that the post style is defined by tkz-graph as post/.style={->,shorten <=1pt,>=stealth',semithick}. As you can see the start of the line is shortened by 1pt, causing the gap. Hence, you could also do for example \tikzset{EdgeStyle/.style={post, shorten <=0}} to remove the shortening. May 14, 2023 at 20:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .