I wanted to draw an almost empty matrix of nodes
with TikZ
similar to the left most one below. All nodes would have same size (through minimum width
and minimum height
) and no separation between columns and rows. But when I include a text which needs two lines I obtain the central matrix and, if the text just needs one line the right most one. I don't know what's wrong. Do you? I'm using CVS version of TikZ
.
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{matrix}
\tikzset{
proces/.style={draw, minimum height=15mm, minimum width=2cm, outer sep=0pt, text width=1.5cm, align=center}
}
\begin{document}
\begin{tikzpicture}
\matrix (A) [matrix of nodes,nodes=proces,nodes in empty cells] {
& \\
& \\
};
\begin{scope}[xshift=4.5cm]
\matrix (A) [matrix of nodes,nodes=proces,nodes in empty cells] {
& OOO OOO \\
& \\
};
\end{scope}
\begin{scope}[xshift=9cm]
\matrix (B) [matrix of nodes,nodes=proces,nodes in empty cells] {
& A \\
& \\
};
\end{scope}
\end{tikzpicture}
\end{document}
nodes={anchor=center}
. The stylematrix of nodes
automatically sets the anchor tobase
and I suspect (only suspect) that this is the cause of the shifts.