phd-thesis-en/figures/bb-activity.tikz

52 lines
1.5 KiB
Plaintext

\documentclass[crop,tikz]{standalone}
\input{common-headers}
\begin{document}
\begin{tikzpicture}[scale=0.4]
\foreach \n [count=\y] in {%
0000000100000000,%
0000001111110000,%
0000001111110000,%
0000001111100000,%
0000001110000000,%
0000011100000000,%
0001111110000000,%
0001111111110000,%
0001111111100000,%
0000011000000000,%
0000000000000000 }
{
\pgfmathtodigitlist{\digitlist}{\n};
\foreach \digit [count=\x, evaluate={\c=\digit*100}] in \digitlist {
\fill[fill=black!\c] (\x,-\y) rectangle ++(1,1);
}
}
\coordinate (ul) at (0,0);
\coordinate (lr) at (17,-11);
\coordinate (bbul) at ($(ul) + (-10pt,10pt)$);
\coordinate (bblr) at ($(lr) + (10pt,-10pt)$);
\draw[very thick] (bbul) rectangle (bblr);
\draw[black!50] (ul) grid ($(lr) + (0,-0.1pt)$);
% width indicator
\pgfmathtodigitlist{\digitlist}{0001111111110000};
\foreach \digit [count=\x, evaluate={\c=\digit*100}] in \digitlist {
\fill[fill=black!\c] (\x,1) rectangle ++(1,1);
}
\draw[black!50] (0,1) grid (17,2);
% height indicator
\pgfmathtodigitlist{\digitlist}{11111111110};
\foreach \digit [count=\x, evaluate={\c=\digit*100}] in \digitlist {
\fill[fill=black!\c] (18,-\x) rectangle ++(1,1);
}
\draw[black!50] (18,0) grid (19,-11);
\node[circle, fill=black, label=below left:{$(x,y)$}] at ($(ul) - (0,11) + (-10pt,-10pt)$) {};
\draw[|.<->.|] (0,-12) -- node[midway,fill=white]{$w$} (17,-12);
\draw[|.<->.|] (-1,-11) -- node[midway,fill=white]{$h$} (-1,0);
\end{tikzpicture}
\end{document}