# [Tex/LaTex] Position two stacked tikz matrices

matricestikz-pgf

I would like to take two TikZ matrix, possibly of different dimensions and stack them. My demo code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]
{
0   & 6 \\
};
\matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]
{
1   & 3 \\
};
\end{tikzpicture}
\end{document}


There should be some space between the matrices and they should be aligned. I've tried to use below of but it doesn't seem to work…

You can also use a scope and shift the entire content.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]
{
0   & 6 \\
};
\begin{scope}[yshift=-1cm]
\matrix [matrix of nodes,row sep=-\pgflinewidth,column 2/.style={nodes={rectangle,draw,minimum width=3em}}]
{
1   & 3 \\
};
\end{scope}
\end{tikzpicture}
\end{document}