I would like to create a so called Stacked Plot type of view to display a combination of data. Perhaps there already is a built in function in Mathematica, but I didn't manage to find it. So, I decided to simply shift the X and Y axis values of plots by a certain value and combine them using Show
.
Here is the example code how I tried to do it:
Do[
Subscript[data, i] = Table[{x, Sin[x + i] + 2*i}, {x, 0, 10, 0.1}];
Subscript[lpl, i] = ListLinePlot[Subscript[data, i], PlotRange -> {{0 + 0.1*i, 10 - 0.1*(10 - i)}, {-1.2, 22.2}}]
, {i, 0, 10}];
Show[Table[Subscript[lpl, i], {i, 0, 10}], Axes -> None, Frame -> {{None, None}, {True, None}}, PlotRange -> {{-0.1, 10.1}, {-1.2, 22.2}}]
You can see, that I shifted the x
values of PlotRange
of each consequent plot by a certain value. However, in the output all of the plots seem to have the same PlotRange
values. The resultant output looks pretty rectangular, like this:
Here are the questions:
- Is it possible to combine several
ListLinePlot
s having differentPlotRange
values usingShow
so, that they retain their individualPlotRange
s, i.e. will be clipped in a combined plot? - Perhaps there is another, better solution to make a Stacked Plot? Here is an example of how a Stacked plot I am aiming for looks like: