# Ground symbol from circuits.ee.IEC library

I wish to draw a ground symbol in a circuit diagram using the circuits.ee.IEC TiKZ library. The example in the PGF Manual (pdf) on page 311 shows exactly what I want. However, when I try to draw it, the wire is extended beyond the ground symbol:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}

\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to[ground] (3,0);
\end{tikzpicture}
\end{document}


How do I fix this, so the ground symbol ends the wire as in the example?

-

You can supply pos=1 to the ground key to position the symbol at the end of the line instead of in the middle:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}

\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) to [ground={pos=1}] (3,0);
\end{tikzpicture}
\end{document}


Or, as percusse suggested in a comment, you could place the symbol as a "proper" node instead of passing it to the to keyword. Note that you'll have to supply an empty set of brackets and use the right keyword (and an appropriate rotate option if the wire isn't going from left to right).

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{circuits.ee.IEC}

\begin{document}
\begin{tikzpicture}[circuit ee IEC]
\draw (0,0) -- (3,0) node [ground, right] {};
\end{tikzpicture}
\end{document}

-
Or you don't make it a connecting node and place it at the end \draw (0,0) -- (3,0) node[ground,right]{}; –  percusse Sep 6 '12 at 15:00
Perfect, thanks! =) –  Tomas Lycken Sep 6 '12 at 15:04
I had to use \draw (0,0) to [ground={pos=1, right}] (3,0); for some reason. –  someonr Jan 17 at 14:46