3

I am drawing Petersen graph.But edges of graphs overlapped with nodes.

\documentclass{article}
\usepackage{animate}
\usepackage{tikz}
\usepackage{tkz-graph}
\usetikzlibrary{arrows}
\usetikzlibrary{lindenmayersystems}
   \usepackage[paperheight=11cm,paperwidth=30cm,bottom=0cm,top=0.21cm,left=0cm,right=0cm]{geometry}



\begin{document}





 \begin{tikzpicture}
  \foreach \x in {18,90,...,306}
  {
 \draw(\x:5cm) circle (7pt)[fill=blue];
 \draw(\x:3cm) circle (7pt)[fill=red];
 \draw(\x:5cm) [line width=3pt]-- (\x+72:5cm);
 \draw(\x:3cm) [line width=3pt] -- (\x+144:3cm);
 \draw(\x:5cm) [line width=3pt] -- (\x:3cm);
  }




 \end{tikzpicture}    
 \end{document}  

1 Answers1

4

Use another loop only to draw the circles so the circles will be drawn over the lines.

\begin{tikzpicture}
 \foreach \x in {18,90,...,306}{%
  \draw  (\x:5cm) [line width=3pt]--  (\x+72 :5cm);
  \draw  (\x:3cm) [line width=3pt] -- (\x+144:3cm);
  \draw  (\x:5cm) [line width=3pt] -- (\x    :3cm);
 }
 \foreach \x in {18,90,...,306}{%
  \draw  (\x:5cm) circle (7pt) [fill=blue];
  \draw  (\x:3cm) circle (7pt) [fill=red];
 }
\end{tikzpicture}

enter image description here

Sigur
  • 37,330