3

I wish to draw a graph with two loops undirected on the same vertice, follows the figure: Graph with two loops I draw the two loops, but got ugly, follows the code:

\begin{tikzpicture}
\draw[fill=black] (2,-1) circle (3pt);
\draw[fill=black] (2,0) circle (3pt);
\draw[fill=black] (2,2) circle (3pt);
\node at (2.5,-1) {$z$};
\node at (2.4,0.1) {$x.y$};
\node at (2,2.3) {$w$};
\draw[thick] (2,0) edge[bend right] (2,2);
\draw[thick] (2,0) edge[bend left] (2,2);
\draw[thick] (2,-1) edge[bend right] (2,0);
\draw[thick] (2,-1) edge[bend left] (2,0);
\draw (2,0) edge [loop left] (2,0);
\draw (2,0) edge [loop below] (2,0);
\end{tikzpicture}

1 Answer 1

1

Is this what you like?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\coordinate (W) at (2,2);
\coordinate (XY) at (2,0);
\coordinate (Z) at (2,-1);
\draw[fill=black] (Z) circle (3pt) node[below=1mm] {$z$};
\draw[fill=black] (XY) circle (3pt) node[right=7mm] {$x.y$};
\draw[fill=black] (W) circle (3pt) node[above=1mm] {$w$};
\draw[thick] (XY) edge[bend right] (W);
\draw[thick] (XY) edge[bend left] (W);
\draw[thick] (Z) edge[bend right] (XY);
\draw[thick] (Z) edge[bend left] (XY);
\draw (XY) edge [loop left, min distance=10mm] (XY);
\draw (XY) edge [loop right, min distance=10mm] (XY);
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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