\documentclass[tikz]{standalone}
\usepackage{pgfcore}
\usepackage{pgfkeys}
\usetikzlibrary{
positioning,
circuits.ee,
circuits.ee.IEC,
}
\begin{document}
\begin{tikzpicture}[circuit ee IEC,
set resistor graphic=var resistor IEC graphic,
set diode graphic=var diode IEC graphic,
set make contact graphic= var make contact IEC graphic]
\node[voltage source] (s) {};
\node[coordinate] (r) [right=30mm of s] {};
\node[coordinate] (l) [right=20mm of r] {};
\node[coordinate] (c) [right=20mm of l] {};
\node (out) [right=10mm of c] {out};
\node[ground] (g) [below=10mm of c, point down] {};
\path
(s) edge [resistor={info=R}] (r)
(r) edge [inductor={info=L}] (l)
(l) edge [capacitor={info=C}] (c)
(c) edge (g)
(c) edge (out);
\end{tikzpicture}
\end{document}
生成:
答案1
使用anchor=west
地面节点的选项末端的解决方案是:
\documentclass[tikz, margin=3mm]{standalone}
\usepackage{pgfcore}
\usepackage{pgfkeys}
\usetikzlibrary{
positioning,
circuits.ee,
circuits.ee.IEC,
}
\begin{document}
\begin{tikzpicture}[circuit ee IEC,
set resistor graphic=var resistor IEC graphic,
set diode graphic=var diode IEC graphic,
set make contact graphic= var make contact IEC graphic]
\node[voltage source] (s) {};
\node[coordinate] (r) [right=30mm of s] {};
\node[coordinate] (l) [right=20mm of r] {};
\node[coordinate] (c) [right=20mm of l] {};
\node (out) [right=10mm of c] {out};
\node[ground] (g) [below=10mm of c, point down, anchor=west] {};
\path
(s) edge [resistor={info=R}] (r)
(r) edge [inductor={info=L}] (l)
(l) edge [capacitor={info=C}] (c)
(c) edge (g)
(c) edge (out);
\end{tikzpicture}
\end{document}
为了进行比较,请参见使用 ciruitikz
包绘制的此方案:
\documentclass[margin=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[american inductors]
\draw (0,0) to [V] (2,0)
to [R=R] (4,0)
to [L=L] (6,0)
to [C=C] (8,0) coordinate (c)
to [short,-o] (9,0) node[right] {out}
(c) to [short,*-] +(0,-1) node[ground] {};
\end{tikzpicture}
\end{document}