\begin{tikzpicture} % % Define colors \definecolor{idlecolor}{RGB}{255, 204, 153} % Light orange \definecolor{refcolor}{RGB}{153, 204, 255} % Light blue \definecolor{backgroundcolor}{RGB}{255, 255, 153} % Light yellow % \newcommand{\ya}{0.5} \newcommand{\yb}{1.5} \newcommand{\yc}{3.5}%6 % %\newcommand{\ya}{0.8} %\newcommand{\yb}{2.08} %\newcommand{\yc}{4.8} % \pgfdeclarelayer{background} \pgfsetlayers{background, main} % Define the axis \begin{axis}[ %width=15cm, height=8cm, axis equal image, xlabel={Time}, ylabel={Current}, xmin=0, xmax=6, ymin=0, ymax=4, xtick=\empty, ytick=\empty, extra y ticks={\ya, \yb, \yc}, extra y tick labels={$I_{DD2N}$, $I_{DD5A}$, $I_{DD5B}$}, axis x line=middle, axis y line=middle, y axis line style={-Latex}, x axis line style={-Latex}, axis line style=thick, ylabel near ticks, xlabel near ticks, ] % Shaded areas %% IDLE energy (orange stripes) %\addplot[domain=0:3.3, fill=idlecolor, pattern=north east lines, draw=none] {1.5} \closedcycle; \begin{pgfonlayer}{background} \draw[pattern=north east lines, pattern color=red!50, draw=none] (axis cs:1,\ya) rectangle (axis cs:2,\yc); \draw[pattern=north east lines, pattern color=red!50, draw=none] (axis cs:4,\ya) rectangle (axis cs:5,\yc); \draw[pattern=north east lines, pattern color=green!50, draw=none] (axis cs:0,0) rectangle (axis cs:6,\ya); \draw[pattern=north west lines, pattern color=blue!50, draw=none] (axis cs:0,\ya) rectangle (axis cs:6,\yb); \end{pgfonlayer} \addplot[thick] coordinates {(0,\ya) (1,\ya)}; \addplot[thick] coordinates {(1,\ya) (1,\yc)}; \addplot[thick] coordinates {(1,\yc) (2,\yc)}; \addplot[thick] coordinates {(2,\yc) (2,\ya)}; \addplot[thick] coordinates {(2,\ya) (4,\ya)}; \addplot[thick] coordinates {(4,\ya) (4,\yc)}; \addplot[thick] coordinates {(4,\yc) (5,\yc)}; \addplot[thick] coordinates {(5,\yc) (5,\ya)}; \addplot[thick] coordinates {(5,\ya) (6,\ya)}; % Mark important points (IDD5PB, IDD5PB_B, I0, IDD2N levels) \addplot[dashed] coordinates {(0,\ya) (6,\ya)}; % IDD2N \addplot[dashed] coordinates {(0,\yb) (6,\yb)}; % IDD5PB \addplot[dashed] coordinates {(0,\yc) (6,\yc)}; % IDD5PB_B % Labels for periods tRFCpb and tREFI8 \draw[thick, {Latex}-{Latex}] (axis cs:1,2.9) -- (axis cs:2,2.9) node[midway,below] {$t_{RFC}$}; \draw[thick, {Latex}-{Latex}] (axis cs:1,2.1) -- (axis cs:4,2.1) node[midway,below] {$t_{REFI}$}; \end{axis} % Legend \begin{scope} \node[draw, pattern=north east lines, pattern color=green!50] at (0.0,-1) {~}; \node[anchor=west] at (0.2,-1) {Background Energy}; \node[draw,pattern=north east lines, pattern color=red!50] at (3.8,-1) {~}; \node[anchor=west] at (4.0,-1) {Burst Refresh Energy}; \node[draw,pattern=north west lines, pattern color=blue!50] at (0.0,-1.5) {~}; \node[anchor=west] at (0.2,-1.5) {Average Refresh Energy}; \end{scope} % \end{tikzpicture}%