我的电路是黑色的。但我想使用 Circuitikz 添加红色部分(标签和箭头,无论颜色如何)。
以下是我使用的代码:
\begin{circuitikz}[american, scale = 0.7, transform shape]\shorthandoff{<>}
\draw
(0,0) to[R, l = $R_1$] (0,3)
to [short] (2,3)
to [R, l=$R_2$] (2,0)
(2,3) to[R, l = $R_3$] (5,3)
to [R, l=$R_4$] (5,0)
to [short] (0,0)
(5,3) to[short, -o] (7,3)
(5,0) to[short, -o] (7,0)
(7,3.3) node {a}
(7,-.3) node {b}
;
\end{circuitikz}
答案1
尝试(使用 TikZ 来获取带有文字的红色箭头):
\documentclass[12pt,border=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{arrows}
%---------------------------------------------------------------%
\begin{document}
\begin{circuitikz}[american, scale = 0.7, transform shape]
\draw
(0,0) to[R, l = $R_1$] (0,3)
to [short] (2,3)
to [R, l=$R_2$] (2,0)
(2,3) to[R, l = $R_3$] (5,3)
to [R, l=$R_4$] (5,0)
to [short] (0,0)
(5,3) to[short, -o] (7,3) node[above] (a) {a}
(5,0) to[short, -o] (7,0) node[below] (b) {b}
;
\draw[>=angle 90,<->,red,% borrowed from TikZ, gives red arrow ...
shorten <=1mm, shorten >=1mm] (a) to node [fill=white] {RTh} (b);
\end{circuitikz}
\end{document}