I'm using tikz to draw a snake-coil edge/path between nodes, but some edges have whitespace before/after its start or end node. Here is a small example:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary[positioning,decorations.pathmorphing]
\begin{document}
\begin{tikzpicture}
\tikzstyle{enclosed} = [draw, circle, inner sep=0pt, minimum size=.15cm, fill=black]
\tikzstyle{enclosedM} = [draw, circle, inner sep=0pt, minimum size=.15cm, fill=red]
\node[enclosed, label={left: $x$}] (x) at (0,2) {};
\node[enclosed, label={right: $y$}] (y) at (4,2) {};
\node[enclosed] (w) at (2,0) {};
\node[enclosed] (v) at (2,4) {};
\node[enclosedM, label={above: $z$}] (z) at (2,1) {};
\node[enclosedM, label={below: $t$}] (t) at (2,3) {};
\draw[decorate,decoration={snake,amplitude=.2mm}]
(x) -- (v)
(v) -- (y)
(x) -- (w)
(w) -- (y)
(x) -- (t)
(v) -- (t)
(y) -- (t)
(x) -- (z)
(w) -- (z)
(z) -- (y);
\end{tikzpicture}
\end{document}
Notice that there is some whitespace between the center bottom node and node z. Also, there is whitespace between the top node and node y.
This still occurs even when "amplitude" is set to 0mm, which I thought would be equivalent to if the edge was not decorated at all. Setting "post length" and "pre length" options with various combinations fixes some edges, but then it creates the same problem with other edges that were OK before.
If I remove the decorate, decorations={...}
and use \draw
as normal with no settings, it works fine but the edges are not wavy. How can I get rid of the whitespace so it behaves as a normal edge but semi-wavy?