# TikZ Scale array of matrices

The following code produces a 3x3 matrix (upper left corner) and an 2x2 array of 3x3 matrices:

How can I reduce the size of the matrix array such that it has the same size as the matrix M? I tried scale=0.5 which had no effect. I want to reduce the size only of the matrix array and not of the entire TikZ picture.

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

\usepackage{tikz}
\usetikzlibrary{matrix, positioning}

\tikzset{
matrixstyle/.style={
matrix of nodes,
nodes={
draw
}
}}

\begin{document}
\begin{tikzpicture}

\matrix (M) [matrixstyle]{
.1 & .1 & .0  \\
.0 & .2 & .8 \\
.2 & .0 & .8 \\
};

\begin{scope} [shift={(M.south)}, below = 0cm of M.south]
\matrix (M11) [matrixstyle]{
.1 & .1 & .0  \\
.0 & .5 & .0 \\
.3 & .0 & .0 \\
};
\matrix (M12) [matrixstyle, right = 0cm of M11]{
.3 & .2 & .0  \\
.0 & .3 & .9 \\
.2 & .1 & .0 \\
};
\matrix (M21) [matrixstyle, below = 0cm of M11]{
.0 & .0 & .0  \\
.0 & .0 & .2 \\
.0 & .0 & .2 \\
};
\matrix (M22) [matrixstyle, right = 0cm of M21]{
.9 & .3 & .0  \\
.0 & .3 & .9 \\
.5 & .0 & .8 \\
};
\end{scope}

\end{tikzpicture}
\end{document}


You could use scale = <scale> and every node/.style = {scale = <scale>} ... whether this is a good idea is a whole different question

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

\usepackage{tikz}
\usetikzlibrary{matrix, positioning}

\tikzset{
matrixstyle/.style={
matrix of nodes,
nodes={
draw
}
}}

\begin{document}
\begin{tikzpicture}

\matrix (M) [matrixstyle]{
.1 & .1 & .0  \\
.0 & .2 & .8 \\
.2 & .0 & .8 \\
};

\begin{scope} [shift={([xshift = -11pt]M.south)}, below = 0cm of M.south, scale = 0.47, every node/.style = {scale = 0.47}]
\matrix (M11) [matrixstyle]{
.1 & .1 & .0  \\
.0 & .5 & .0 \\
.3 & .0 & .0 \\
};
\matrix (M12) [matrixstyle, right = -6pt of M11]{
.3 & .2 & .0  \\
.0 & .3 & .9 \\
.2 & .1 & .0 \\
};
\matrix (M21) [matrixstyle, below = -6pt of M11]{
.0 & .0 & .0  \\
.0 & .0 & .2 \\
.0 & .0 & .2 \\
};
\matrix (M22) [matrixstyle, right = -6pt of M21]{
.9 & .3 & .0  \\
.0 & .3 & .9 \\
.5 & .0 & .8 \\
};
\end{scope}

\end{tikzpicture}
\end{document}


• Why do I need [xshift = -11pt]? Is there an exact solution, which does the centering automatically? – Samuel Jan 11 at 18:07