I'm able to plot a single chart but not certain how multiple charts can be layered with parallel lines connecting them all. An example is below; any help is greatly appreciated.
Asked
Active
Viewed 39 times
-1
-
Something like https://tex.stackexchange.com/a/445017 ? – Jan 27 '20 at 06:46
1 Answers
2
You may just add several axis object shifted relative to each other.
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[/pgfplots/.cd,axis
lines=left,width=4cm,xtick=\empty,ytick=\empty]
\begin{axis}
\addplot[mark=none] {exp(-x)};
\end{axis}
\begin{axis}[xshift=-1cm,yshift=-1cm]
\addplot[mark=none] {exp(-pow(x-2,2))};
\end{axis}
\begin{axis}[xshift=-2cm,yshift=-2cm]
\addplot[mark=none] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}
If you had data, I could use it and probably use a loop to simplify the code. For now, I use random plots.
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[/pgfplots/.cd,axis
lines=left,width=4cm,xtick=\empty,ytick=\empty,ymax=2,ymin=-0.5,
xlabel=$t$]
\foreach \X in {1,...,4}
{\begin{axis}[xshift=-\X*1cm,yshift=-\X*1cm,ylabel=$f_\X(t)$]
\addplot[mark=none,smooth] {rnd};
\path (-3,-0.5) coordinate (L\X) (3,-0.5) coordinate (R\X) ;
\end{axis}}
\draw[densely dashed] (L1) -- (L4) (R1) -- (R4);
\end{tikzpicture}
\end{document}
-
Thank you so much this is great. I'm trying to understand what the following dows /pgfplots/.cd as adding font=\sffamily\small doesnt reduce the size of the math text? also would it be possible to make the y-axis a little smaller and the x-axis a little longer and change the angle so the entire diagram is longer than it is tall? – user175199 Feb 01 '20 at 10:30
-
also would it be possible to add the 2 red lines in the original diagram? thanks again – user175199 Feb 01 '20 at 10:36


