答案1
使用纯净的tikz
:
\documentclass[margin=3mm]{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{chains,
positioning}
\begin{document}
\begin{tikzpicture}[
node distance = 1cm and 0mm,
start chain = c going right,
N/.style args = {#1/#2}{draw, fill=#1,
minimum height=1cm, minimum width=#2cm,
outer sep=0, node contents,
on chain=c}
]
\node[N=green/3,above right=of {(0,0)}];
\node[N=red/1];
\node[N=blue/1];
\node[N=red/3];
%
\node[N=green/5, below right = of c-4.south east];
%
\node[N=orange/2, below right = 5mm and 0mm of c-5.south west];
\draw (8,2.5) node[above] {$C_2$} -- ++ (0,-5.5);
\foreach \i in {0,1,...,14}
\node[fill=white] at (\i,0.5) {\i};
\end{tikzpicture}
\end{document}