TikZ: Align array of matrices

Although not exactly the same, something very similar can be done with some tabular and without TiKZ.

\documentclass{article}

\newcommand{\mytab}[4]{%
    \begin{tabular}[c]{|c|c|}
        \hline
     #1&#2\\\hline
     #3&#4\\\hline
    \end{tabular}}

\begin{document}

\mytab{.2}{.2}{.2}{.2}\  
\begin{tabular}[c]{cccc}
\mytab{.1}{.0}{.5}{.2} & \mytab{.1}{.1}{.1}{.1}
\\[.5cm]
\mytab{.0}{.0}{.0}{.2} & \mytab{.3}{.0}{.3}{.9} 
\end{tabular}\ 
\mytab{.2}{.0}{.3}{.9} 
\end{document}

enter image description here

EDIT: or even better with ytableau package

\documentclass{article}
\usepackage{ytableau}

\newcommand{\mytab}[4]{%
    \begin{ytableau}
     #1&#2\\
     #3&#4\\
    \end{ytableau}}

\begin{document}
\ytableausetup{centertableaux}

\mytab{.2}{.2}{.2}{.2}\  
\begin{tabular}[c]{cccc}
\mytab{.1}{.0}{.5}{.2} & \mytab{.1}{.1}{.1}{.1}
\\[.5cm]
\mytab{.0}{.0}{.0}{.2} & \mytab{.3}{.0}{.3}{.9} 
\end{tabular}\ 
\mytab{.2}{.0}{.3}{.9} 
\end{document}

enter image description here


like this?

enter image description here

matrices you can consider as nodes, so their positioning is with positioning library is straightforward:

\documentclass[tikz,border=1mm]{standalone}
\usetikzlibrary{matrix, positioning}

\begin{document}
    \begin{tikzpicture}[
     node distance = 1mm and 2mm,
every matrix/.style = {matrix of nodes,
                      nodes={draw},
                      column sep=-\pgflinewidth,
                      row sep=-\pgflinewidth}
                        ]
\matrix (m1) 
{
.2 & .2  \\
.2 & .2 \\
};
\matrix (m11) [above right=of m1.east]
{
.1 & .0  \\
.5 & .0 \\
};
\matrix (m12) [right=of m11]
{
.1 & .1 \\
.1 & .1 \\
};
\matrix (m21) [below right= of m1.east]
{
.0 & .0  \\
.0 & .2 \\
};
\matrix (m22) [right = of m21]{
.3 & .0  \\
.3 & .9 \\
};

\matrix (m2) [right = of m1 -| m12.east]
{
.2 & .0  \\
.3 & .9 \\
};
    \end{tikzpicture}
\end{document}

Tags:

Tikz Pgf