# How to better plot the collector and base current of a transistor

MWE is here.

\documentclass{standalone}
\usepackage{circuitikz}
\usetikzlibrary {calc}
\begin{document}

\begin{circuitikz}[european]
\ctikzset{
v/.append style={/tikz/american voltages},
resistors/scale=0.8,
capacitors/scale=0.7,
diodes/scale=0.6,
transistors/scale=1.3,
}
\draw (0,0) node[npn](VT){VT};
\draw (VT.C) to[R=$R_\mathrm{c}$] ++(0,2) to[short, -o] +(2,0)node[right]{$+V_\mathrm{CC}$};
\draw (VT.C) to[short,*-,C=$C_2$] ++(2,0);
\draw (VT.B) to[short,*-,C,l_=$C_1$] ++(-2,0);
\coordinate (c) at ($(VT.C)+(0,2)$); % c坐标 Rc所在垂线与Vcc所在水平线交点
\coordinate (b) at ($(VT.B)+(-2,0)$);% b坐标 C1所在水平线左端终点
\coordinate (a1) at ($(b)+(0,-3)$);  % a1坐标 us所在垂线下方终点
\coordinate (a2) at ($(VT.C)+(2,0)$);% a2坐标 C2所在水平线右端终点
\draw (VT.B) to[R=$R_\mathrm{b}$] (VT.B|-c) to[short,-*](c);
\draw (b) to[R,l_=$R_\mathrm{S}$] +(0,-1.5)
to[vsource, v_=$u_\mathrm{S}$] +(0,-3)
to[short,-*](a1-|VT.E) to[short,i^<=$i_\mathrm{E}$] (VT.E);% 从C1左端终点开始往下、
右、上回到VT发射极节点VT.E。即输入回路
\draw (a1-|VT.E) --(a1-|a2) to[R=$R_\mathrm{L}$] (a2);% 从发射极下方节点往右出发向上构成输出回路
\draw (a1-|VT.E)node[rground]{};
\draw (VT.B)node[yshift=-15pt, flowarrow]{$i_\mathrm{B}$};
\draw (VT.C)node[xshift=-15pt, rotate = 270, flowarrow]{$i_\mathrm{C}$};
\end{circuitikz}
\end{document}


I want the current label to be to the left and below the arrow, and to not rotate. Or is there a better command to control label behavior, which might involve TikZ commands, but I'm not familiar with them.

With dirty (quick) trick: write arrow with

\draw (VT.B)node[yshift=-5pt, flowarrow, label=below:$i_\mathrm{B}$] {};
\draw (VT.C)node[xshift=-5pt, rotate=270, flowarrow, label=left:$i_\mathrm{C}$] {};


Addendum: If you willing to redraw your scheme from scratch, solution can be incorporate in loops of scheme elements:

\documentclass{standalone}
\usepackage{circuitikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{circuitikz}[european]
\ctikzset{
v/.append style={/tikz/american voltages},
resistors/scale=0.8,
bipoles/capacitor/height=0.5,
bipoles/capacitor/width=0.1,
transistors/scale=1.3,
}
\node[npn](VT){VT};
\draw   (VT.C)  node[xshift=-5pt, flowarrow, rotate=-90,
label= left:$i_\mathrm{C}$] {}
to[R=$R_\mathrm{c}$,*-] ++(0,2) coordinate (a)
to[short, -o]  ++ (2,0) node[right]{$+V_\mathrm{CC}$}
(VT.B)  node[yshift=-5pt, flowarrow,
label=below:$i_\mathrm{B}$]{}
to[C,l_=$C_1$,*-] ++(-2,0)
to[R,l_=$R_\mathrm{S}$] ++(0,-1.5)
to[V, v_=$u_\mathrm{S}$] ++(0,-1.5) coordinate (b)
(a)     to[short, *-]  (a -| VT.B)
to[R, a=$R_\mathrm{b}$]    (VT.B)
(VT.E)  to[short,i_=$i_\mathrm{E}$, -*] (VT.E |- b)
node (g) [below, rground]{}
-- (b)
(VT.C)  to[short,C=$C_2$,*-] ++(2,0)    coordinate (c)
to[R=$R_\mathrm{L}$] (c |- b)
-- (g);
\end{circuitikz}
\end{document}


Result is the same as before.

• Thank you again, this is really elegant code！ Commented Feb 19, 2023 at 4:34