# Array Alignment using TikZ Matrices; cell over a complete row

I want to align subplots in a pgfplot.

with \matrix it is easy to align pictures. My problem is, that I need several rows with two columns/pictures and a last row with a picture over both columns.

Here the not working code illustrating what I wanted to do

\documentclass[a4paper,oneside,10pt]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[USenglish]{babel}

\usepackage{tikz,pgfplots}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{figure} [H]
\centering
\begin{tikzpicture}
\matrix{
\begin{axis}[width=0.45\textwidth,height=0.45\textwidth]
\end{axis}
&
\begin{axis}[width=0.45\textwidth,height=0.45\textwidth]
\end{axis}
\\
\begin{axis}[width=0.9\textwidth,height=0.45\textwidth]
\end{axis}
\\
};
\end{tikzpicture}
\end{figure}

\end{document}


that's the unwanted result

and that's how I wanted it to look

• Manual for Package pgfplots by Christian Feuersaenger
• TikZ & PGF Manual by Till Tantau

Does anybody has a solution for doing it with /matrix (highly appreciated) or maybe another solution?

kind regards Benjamin

The \hspaces may need to be tweaked, but alignment issues are compounded by the fact that horizontal-axis labels (in some but not all cases) protrude beyond the bounding box of the graphs, and also because not all vertical -axis labels are same width (because of negatives). The underlying \stackon method is, by default, center aligned. If you think making it left-aligned might make things easier, \def\stackalignment{l} before you begin will accomplish it.

\documentclass[a4paper,oneside,10pt]{scrreprt}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[USenglish]{babel}
\usepackage{stackengine}

\usepackage{tikz,pgfplots}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{figure} [H]
\centering
\stackon[5pt]{%
\begin{tikzpicture}
\begin{axis}[width=0.9\textwidth,height=0.45\textwidth]
\end{axis}
\end{tikzpicture}
}{%
\begin{tikzpicture}
\begin{axis}[width=0.45\textwidth,height=0.45\textwidth]
\end{axis}
\end{tikzpicture}%
\hspace{5.5ex}%
\begin{tikzpicture}
\begin{axis}[width=0.45\textwidth,height=0.45\textwidth]