I want to have two subplots with the same x axis aligned above one another.
In the manual I read, that I should use \matrix{} to achieve this.
Now I want to have legends in both plots. But since the legend box itself seems to use the matrix environment, this gives me the error "You cannot nest pgfmatrix environments, yet."
Here is a reduced example of what does not work:
\begin{tikzpicture}
\matrix{
\begin{axis}
\addplot {x} ;
\addlegendentry{x};
\end{axis}\\
};
\end{tikzpicture}
Any ideas?
