\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) -- (0.4,2.6);
\draw (1.6,2.6) to[empty diode, l_=$D_1$] (0.4,2.6);
\draw (1.6,2.6) node[circ]{} to[short, -o] (3.8,2.6);
\draw (1.6,2.6) to[R, l=$R_1$] (1.6,1.3) to[battery1, l_={$V_\mathrm{B} = 2$ V}] (1.6,0);
\draw (0,0) -- (1.6,0) to[short, -o] (3.8,0);
\node at (3.4,2.15) {$+$}; \node at (3.6,1.4) {$V_\mathrm{out}$}; \node at (3.4,0.45) {$-$};
\node[right] at (-0.6,-0.6) {$V_\mathrm{in}>2$ V: Diode off};
\begin{scope}[xshift=6.6cm, yshift=1.2cm]
\axes{-1.6}{3.0}{-1.2}{2.0}{$V_\mathrm{in}$}{$V_\mathrm{out}$}
\draw[cv] (-1.2,-1.2) -- (1.1,1.1) -- (2.8,1.1); \yt{1.1}{2 V} \xt{1.1}{2 V}
\end{scope}
\end{circuitikz}
\end{document}
