Subdividing and Filling a Tikz Rectangle

You could use a chain and position the first node in the chain using the anchors of the unsplit nodes:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{chains}



\begin{document}

\newlength\nodewidth
\setlength\nodewidth{40mm}

\tikzset{%
    fill1/.style={fill=red!30,outer sep=0pt},
    fill2/.style={fill=green!30,outer sep=0pt},
    split/.style={%
        minimum width=0.5/3*\nodewidth,
        minimum height=5mm,
        %inner sep=0pt,
        outer sep=0pt,
        on chain},
    split1/.style={split,fill1},
    split2/.style={split,fill2},
}

\begin{tikzpicture}[%
    start chain,
    node distance=0pt]

    \node [fill1,minimum width=\nodewidth] (b1) {Bank 1 1024 MiB};
    \node [fill2,minimum width=\nodewidth,right=of b1] (b2) {Bank 2 1024 MiB};

    \node [split1,anchor=north west] at (b1.south west) {};
    \node [split2] {};
    \foreach \n in {0,1,...,4} {%
        \node [split1] {};
        \node [split2] {};
    };

\end{tikzpicture}

\end{document}

You can use the TikZ \scope instruction to make your picture local and then use shifts and scales as options to the \scope to place the whole group where you want it.

Tags:

Tikz Pgf