Version 12 includes a new Layout->Column
option for ListPlot which aligns multiple plots so they share a single horizontal axis. It seemed really useful at first. But data being compared in this way can have very different vertical scales.
It appears that the new capability always sets the PlotRange of all the data sets to the same value:
d1 = Table[{x, .1 Sin[x]}, {x, 0, 3 Pi, Pi/9}];
d2 = Table[{x, Cos[x]}, {x, 0, 4 Pi, Pi/7}];
ListLinePlot[{d1, d2}, PlotLayout -> "Column",
InterpolationOrder -> 2, GridLines -> Automatic,
PlotRange -> Automatic]
I have tried what seems reasonable to set the ranges separately:
ListLinePlot[{d1, d2}, PlotLayout -> "Column",
InterpolationOrder -> 2, GridLines -> Automatic,
PlotRange -> {{Automatic, Automatic}, {Automatic, Automatic}}]
ListLinePlot[{d1, d2}, PlotLayout -> "Column",
InterpolationOrder -> 2, GridLines -> Automatic,
PlotRange -> {{Automatic, {-.1, .1}}, {Automatic, {-1, 1}}}]
But neither of these work. The first gives the same result, and the second throws an error. Does anyone have any insight into this?
EDIT:
Thank you @Szabolcs. Your solution not only solves the range problem, but permits differing scaling functions. (A cross section of a biased semiconductor junction may want to plot potentials from 0 to 10 volts, but also carrier concentrations from 0 to 1E18 on a log scale.)
d3 = Table[{x, Exp[10 Cos[x]]}, {x, 0, 4 Pi, Pi/100}];
GraphicsColumn[
{
ListLinePlot[d1, InterpolationOrder -> 2, GridLines -> Automatic,
PlotRange -> {{0, 4 Pi}, Automatic}, Frame -> True,
FrameTicks -> {{Automatic, None}, {None, None}},
FrameLabel -> {None, "Linear"}],
ListLinePlot[d3, InterpolationOrder -> 2, GridLines -> Automatic,
PlotRange -> {{0, 4 Pi}, All}, Frame -> True, FrameLabel -> "Log",
ScalingFunctions -> "Log"]
}
]
GraphicsColumn[{...}, Spacings -> {0, -30}]
if you need. $\endgroup$