I'm using the tikz matrix package to draw two matrices. I'd obviously like the two matrices not to be drawn on top of each other but when I try to adjust the position of one of the matrices neither its' labels nor the nodes I draw using the named cells in that matrix move along with it.
Here is the code I'm using (note I'm compiling with xelatex and haven't checked with pdflatex)
\documentclass[leqno]{amsart}
\usepackage{tikz}
\usetikzlibrary{matrix,calc,positioning,tikzmark,patterns,fit,matrix.skeleton}
\begin{document}
\begin{tikzpicture}
\matrix (x) [matrix of math nodes,style contour = {draw, very thick},style grid = {draw, thin},label=above:\( X_e \),nodes in empty cells=true,ampersand replacement=\&] {
\& \\
\& \\
\& \\
\& \\
\& \\
};
\matrix (m) at (4,0) [matrix of math nodes,style contour = {draw, very thick},style grid = {draw, thin},label={above:\( A \)},nodes in empty cells=true,ampersand replacement=\&] {
\& \& \\
\& \& \\
\& \& \\
\& \& \\
\& \& \\
};
\node[black] (val-m-5-3) at (m-5-3) {1};
\node[black,circle,draw,minimum size=2.2mm] (circle-m-5-3) at (m-5-3) {};
\fitandstyle[background]{(m-cell-1-1) (m-cell-3-1)}{fill=Gray};
\fitandstyle[background]{(m-cell-1-2) (m-cell-3-3)}{pattern=crosshatch};
\end{tikzpicture}
\end{document}
Here is the result I get in which (weirdly) the label for the matrix m and the attempts to draw into that matrix don't track with the matrix while the fills executed using matrix.skeleton move with it.
What do I need to do to get the label and items drawn using the cell names (e.g. m-5-3) to move with the matrix? Note the same thing happens when I try to add: right = 2cm of x to the keys passed to matrix m.
Note that this is what I want the matrix m to look like and what happens if I don't include the positioning info and delete the matrix x (don't worry about the overflow of the circle…that's an artifact of code simplification I did to post this).