\documentclass[border=4pt]{standalone}
\usepackage{ga}
\input{../fm.tikz}
\begin{document}
\begin{circuitikz}[font=\small]
\draw (0,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0,2.6) to[R, l=$R_1$] (1.4,2.6) to[battery1, l=$V_\mathrm{B}$] (2.6,2.6) node[circ]{} to[short, -o] (3.6,2.6);
\node[font=\footnotesize] at (2.0,2.05) {2 V};
\draw (2.6,0) to[empty diode, l_=$D_1$] (2.6,2.6);
\draw (0,0) -- (2.6,0) to[short, -o] (3.6,0); \draw (1.3,0) node[ground]{};
\node at (3.6,2.15) {$+$}; \node at (3.8,1.3) {$V_\mathrm{out}$}; \node at (3.6,0.45) {$-$};
\node[right] at (-0.6,-1.0) {$V_\mathrm{in}<2$ V: Diode is on};
\begin{scope}[xshift=6.6cm, yshift=0.8cm]
\axes{-1.6}{3.0}{-1.0}{2.0}{$V_\mathrm{in}$}{$V_\mathrm{out}$}
\draw[cv] (-1.5,0) -- (1.1,0) -- (2.6,1.5); \xt{1.1}{2 V}
\end{scope}
\end{circuitikz}
\end{document}
