I have rewritten this using pgfplots
, which is intended for plotting data and functions (rather than TiKz
which is better for schematics). Here is my initial try. You need to play a little with the options to adjust the plot to your likening.
\documentclass[mathserif]{beamer}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.12}
\begin{document}
\vspace*{1in}
\begin{tikzpicture}
\begin{axis}[
xlabel = Time $t$,
xmin=-1,xmax = 9,
hide y axis,
axis x line=bottom,
xticklabels={,,},
xtick style = {draw = none},]
\node[scale=0.1] (a) at (axis cs: 1.5,1.5) {\phantom{$.$}};
\node[scale=0.1] (b) at (axis cs: 1.5,0.5) {\phantom{$.$}};
\node[scale=0.9] (c) at (axis cs: 7,3.5) {{$N_{\alpha}(t)$}};
\node[scale=0.9] (e) at (axis cs: 6,3) {{$N_d(t)$}};
\node[scale=0.1] (f) at (axis cs: 3.8,2.1) {\phantom{$.$}};
\node[scale=0.9] (g) at (axis cs: 5,1.5) {{Area $u(t)$}};
\draw[<->] (a) edge node[midway,] {{\scriptsize X($t$)}} (b);
\draw[-] (f)--(g);
\addplot[name path = A,no markers,color=blue,thick] coordinates {
(0,0)
(0,0.5)
(0.7,0.5)
(0.7,1)
(1.1,1)
(1.1,1.5)
(2,1.5)
(2,2)
(3,2)
(3,2.5)
(3.6,2.5)
(3.6,3)
(4.6,3)
(4.6,3.5)
(5.7,3.5)
};
\addplot[name path = B,no markers,color=purple,thick] coordinates {
(1,0)
(1,0.5)
(1.7,0.5)
(1.7,1)
(2.1,1)
(2.1,1.5)
(2.6,1.5)
(2.6,2)
(4,2)
(4,2.5)
(5,2.5)
(5,3)
(5.5,3)
(5.5,3.5)
(6.5,3.5) };
\addplot[gray!50] fill between[of=A and B];
\end{axis}
\end{tikzpicture}
\end{document}
using double :
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\draw[double=green] (3.1,4.2) -- (2.45,3.8);
\end{tikzpicture}
\begin{tikzpicture}
\draw[double=green, double distance=.1cm] (3.1,4.2) -- (2.45,3.8);
\end{tikzpicture}
\begin{tikzpicture}
\draw[double=green, double distance=.2cm] (3.1,4.2) -- (2.45,3.8);
\end{tikzpicture}
\end{document}
Best Answer
You can also use intersection segments, although these require the
pgfplots
package and thefillbetween
library.The layers are needed for the fill to appear below the lines.
Ouput
Code