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}
2
  • Can you post some code please?
    – user11232
    Commented Sep 4, 2015 at 16:00
  • @Harish: Sample added.
    – ASdeL
    Commented Sep 4, 2015 at 16:11

2 Answers 2

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}
3
  • Thanks, but I'm not using beamer. Besides, I do not want the holes when the vertices are invisible. Edges should touch.
    – ASdeL
    Commented Sep 4, 2015 at 16:09
  • @ASdeL So, are we supposed to guess what you are using and what do you want? Please add to your question all relevant information and a minimal example with your current settings. Commented Sep 4, 2015 at 16:11
  • @ASdeL Please see my updated answer. Commented Sep 4, 2015 at 16:14
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.

1
  • To answer your question, please see my updated answer. Commented Sep 7, 2015 at 17:00

You must log in to answer this question.

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