![如何使用基于 circuitikz 的相对坐标在 circuitikz 电路内插入 tikzpicture?](https://linux22.com/image/306107/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%9F%BA%E4%BA%8E%20circuitikz%20%E7%9A%84%E7%9B%B8%E5%AF%B9%E5%9D%90%E6%A0%87%E5%9C%A8%20circuitikz%20%E7%94%B5%E8%B7%AF%E5%86%85%E6%8F%92%E5%85%A5%20tikzpicture%EF%BC%9F.png)
具体来说,我想在这个电路的两个开口端(R1 和地之间)插入一个矩形?
\documentclass[border=10pt]{standalone}
\usepackage[american,siunitx,smartlabels]{circuitikz}
\ctikzset{bipoles/ammeter/text rotate/.initial=0, rotation/.style={bipoles/ammeter/text rotate=#1},
}
\begin{document}
\begin{circuitikz}
\draw (0,0)
node[transformer,yscale=1.2] (T) {}
(T.B1) to [D,l=Diode] (3,|-T.B1)
to [R,l=3.3 <\kilo\ohm>] (3,|-T.B2)
-- (T.B2)
-- (12,|-T.B2);
\ctikzset{bipoles/resistor/height =0.3}
\draw (3,|-T.B1)
to [vR,l=$R_1{=} 0 $] (6,|-T.B1)
to (6,-0.2)
(12,|-T.B2) node [below=1pt]{X-Channel}
(6,|-T.B1) to [short,-*] ++(2,0) node [right=2pt]{Y-Channel}
(6,-1) to [short] ++ (2.2,0) node [ground,xscale=0.5,yscale=0.7] {}
(T) node [right=15pt,below=30pt,rotate = 90] {$\SI{9}\volt_{rms}$}
;
\end{circuitikz}
\end{document}
答案1
像这样?
\documentclass[border=10pt]{standalone}
\usepackage[american,siunitx,smartlabels]{circuitikz}
\ctikzset{bipoles/ammeter/text rotate/.initial=0, rotation/.style={bipoles/ammeter/text rotate=#1},
}
\begin{document}
\begin{circuitikz}
\draw (0,0)
node[transformer,yscale=1.2] (T) {}
(T.B1) to [D,l=Diode] (3,|-T.B1)
to [R,l=3.3 <\kilo\ohm>] (3,|-T.B2)
-- (T.B2)
-- (12,|-T.B2);
\ctikzset{bipoles/resistor/height =0.3}
\draw (3,|-T.B1)
to [vR,l=$R_1{=} 0 $] (6,|-T.B1)
to (6,-0.2)
(12,|-T.B2) node [below=1pt]{X-Channel}
(6,|-T.B1) to [short,-*] ++(2,0) node [right=2pt]{Y-Channel}
(6,-1) to [short] ++ (2.2,0) node [ground,xscale=0.5,yscale=0.7] {}
(T) node [right=15pt,below=30pt,rotate = 90] {$\SI{9}\volt_{rms}$}
(6,-0.9) rectangle +(2,0.6)
;
\end{circuitikz}
\end{document}