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}
  • Can you post some code please? – user11232 Sep 4 '15 at 16:00
  • @Harish: Sample added. – ASdeL Sep 4 '15 at 16:11
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}
  • Thanks, but I'm not using beamer. Besides, I do not want the holes when the vertices are invisible. Edges should touch. – ASdeL Sep 4 '15 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. – Gonzalo Medina Sep 4 '15 at 16:11
  • @ASdeL Please see my updated answer. – Gonzalo Medina Sep 4 '15 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.

  • To answer your question, please see my updated answer. – Gonzalo Medina Sep 7 '15 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.