3

Is it possible to hide the vertices while using package tkz-graph? Firstly I want to show just the edges, and then show the whole graph. However, I need the vertices from the beginning in order to draw the edges between them. I tried with MinSize=0pt without success.

\documentclass{article}
\usepackage{tkz-graph}
\begin{document}
    Without vertices (fail; vertices are still visible):
    \SetVertexSimple[MinSize=0pt] 
    \begin{tikzpicture}
        \Vertex{A}
        \Vertex[x=4,y=0]{B}
        \Vertex[x=1,y=2]{C}
        \Edge[style={bend left}](B)(A)
        \Edges(A,B,C,A)
    \end{tikzpicture}
    With vertices:
    \SetVertexSimple[MinSize=10pt]
    \begin{tikzpicture}
        \Vertex{A}
        \Vertex[x=4,y=0]{B}
        \Vertex[x=1,y=2]{C}
        \Edge[style={bend left}](B)(A)
        \Edges(A,B,C,A)
    \end{tikzpicture}
\end{document}
ASdeL
  • 4,925

2 Answers2

2

Sure. You can use VertexStyle/.style={shape=coordinate} to make the vertices coordinates, so the edges will touch:

\documentclass{article}
\usepackage{tkz-graph}
\begin{document}
    \SetVertexSimple[MinSize=10pt]
    \begin{tikzpicture}
        \Vertex{A}
        \Vertex[x=4,y=0]{B}
        \Vertex[x=1,y=2]{C}
        \Edge[style={bend left}](B)(A)
        \Edges(A,B,C,A)
    \end{tikzpicture}\qquad
    \begin{tikzpicture}[VertexStyle/.style={shape=coordinate}]
        \Vertex{A}
        \Vertex[x=4,y=0]{B}
        \Vertex[x=1,y=2]{C}
        \Edge[style={bend left}](B)(A)
        \Edges(A,B,C,A)
    \end{tikzpicture}
\end{document}

enter image description here

Another option would be to use the empty key for all vertices:

\documentclass{article}
 \usepackage{tkz-graph}
\begin{document}
\begin{tikzpicture}
\presetkeys[GR]{vertex}{empty=true}{}
         \Vertex{A}
         \Vertex[,x=4,y=0]{B}
         \Vertex[,x=1,y=2]{C}
         \Edge[style={bend left}](B)(A)
         \Edges(A,B,C,A)
\end{tikzpicture}
\begin{tikzpicture}
         \Vertex{A}
         \Vertex[,x=4,y=0]{B}
         \Vertex[,x=1,y=2]{C}
         \Edge[style={bend left}](B)(A)
         \Edges(A,B,C,A)
\end{tikzpicture}
\end{document}
Gonzalo Medina
  • 505,128
0

Local option empty can be used in a node by node basis (although tiny holes are shown).

 \documentclass{article}
 \usepackage{tkz-graph}
 \begin{document}
     \begin{tikzpicture}
         \Vertex[empty]{A}
         \Vertex[empty,x=4,y=0]{B}
         \Vertex[empty,x=1,y=2]{C}
         \Edge[style={bend left}](B)(A)
         \Edges(A,B,C,A)
     \end{tikzpicture}
 \end{document}

I wonder whether is it possible to specify empty just once.

ASdeL
  • 4,925