1

I'd like to create something like in this picture (done in PowerPoint) with TikZ/pgfplots. I would be really happy if someone knows of an example that I could use for inspiration!

Thanks a lot!

Graph plot

  • The three axis should basically be the same size, but shifted into the "depth"/z direction. – user111304 Aug 03 '16 at 13:07
  • 2
    I would suggest putting each axis environment in a scope and using xshift and yshift to move their respective origins. The dashed line would be drawn outside the scopes using previously defined coordinate names. – John Kormylo Aug 03 '16 at 13:38

1 Answers1

0

Most of my answer is setup for this particular MWE, since the OP provided no graphs to be overlaid... I had to create my own.

After spending most of the code building a green, blue, and red graph as placeholders (they could be something with tikz instead), I then use \stackinset to lay them up relative to each other and to overlay some dashed orange lines.

Here is the MWE. Look to the end for the nested \stackinsets that actually accomplish the graph.

\documentclass{article}  
\usepackage[usestackEOL]{stackengine}
\usepackage{xcolor,graphicx,amssymb}
\begin{document}
%%%%% THE FOLLOWING IS ME DEFINING THREE GRAPHS; YOUR CODE WILL BE DIFFERENT
\setstackgap{L}{.5cm}
\def\stacktype{L}
% DASHED LINE OF SPECIFIED LENGTH
% From morsburg at http://tex.stackexchange.com/questions/12537/
% how-can-i-make-a-horizontal-dashed-line/12553#12553
\def\solidfill{\cleaders\hbox to .1cm{\rule{.1cm}{1pt}}\hfill}
\newcommand\dashfill[1][.4pt]{\cleaders\hbox to .2cm{\rule{.05cm}{#1}}\hfill}
\newcommand\dashline[2][.4pt]{\hbox to #2{\dashfill[#1]\hfil}}
\newcommand\solidline[1]{\hbox to #1{\solidfill\hfil}}
\newcommand\DL{\textcolor{black!30}{\dashline{4.3cm}}}
\newcommand\SL{\solidline{4.4cm}\makebox[.2cm][r]{\arrowhead}}
\def\arrowhead{\raisebox{-2.6pt}{$\blacktriangleright$}}
\savestack\partblue{\color{blue}\Longstack{\SL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL}}
\savestack\partred{\color{red}\Longstack{\SL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL}}
\savestack\partgreen{\color{green}\Longstack{\SL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL\\ \DL}}
\def\basegrid#1{\color{#1}%
\stackinset{l}{15pt}{t}{3pt}{$y$}{%
  \stackinset{r}{0pt}{b}{12pt}{$x$}{%
    \stackon[-.5cm]{\raisebox{7.5\dimexpr\Lstackgap}{\scalebox{1}[-1]{%
    \csname part#1\endcsname}}}{\rotatebox{90}{\csname part#1\endcsname}}%
}}}
\savestack\gridblue{\basegrid{blue}}
\savestack\gridred{\basegrid{red}}
\savestack\gridgreen{\basegrid{green}}
%%%%%

%%%%% HERE IS WHERE I OVERLAY THE THREE GRAPHS
%%%%% NOTE: \Lstackgap IS THE SPACING BETWEEN DASHED GRID RULES

% ORANGE DASHES
\stackinset{l}{9.5\dimexpr\Lstackgap}{b}{2.1\dimexpr\Lstackgap}{\rotatebox{-115}{%
  \color{orange!90!black}\dashline[2pt]{2.7\dimexpr\Lstackgap}}}{%
\stackinset{l}{3.5\dimexpr\Lstackgap}{b}{0.1\dimexpr\Lstackgap}{\rotatebox{-115}{%
  \color{orange!90!black}\dashline[2pt]{2.7\dimexpr\Lstackgap}}}{%
% OVER STAGGERED GRID
\stackinset{l}{10\dimexpr\Lstackgap}{b}{4\dimexpr\Lstackgap}{\gridred}{%
\stackinset{l}{4\dimexpr\Lstackgap}{b}{2\dimexpr\Lstackgap}{\gridblue}{\gridgreen}}%
}}


\end{document}

enter image description here