I am using tikz matrix to generate shapes of shaded cells. I have the following code working to generates the shape I am looking for in this example. It is just a matrix with some defined fills and patternfills.
\documentclass[11pt]{article}
\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{matrix,patterns,shadings,backgrounds}
\pgfdeclarelayer{myback}
\pgfsetlayers{myback,background,main}
\tikzset{myfillcolor/.style = {draw,fill=#1}}%
\NewDocumentCommand{\highlight}{O{black!20} m m}{%
\draw[myfillcolor=#1] (#2.north west)rectangle (#3.south east);
}
\NewDocumentCommand{\fillpatternh}{O{horizontal lines} O{black!20} m m}{%
\draw[pattern=#1, pattern color=#2] (#3.north west)rectangle (#4.south east);
}
\NewDocumentCommand{\fillpatternch}{O{crosshatch} O{black!20} m m}{%
\draw[pattern=#1, pattern color=#2] (#3.north west)rectangle (#4.south east);
}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\matrix (m)[matrix of nodes, style={nodes={minimum width=4em}}, minimum height=2em, ampersand replacement =\&]% row sep=-\pgflinewidth, column sep=-\pgflinewidth,
{
{} \& {} \& {} \\
{} \& {} \& {} \\
};
\begin{pgfonlayer}{background}
\fillpatternh{m-1-1}{m-1-1}%
\highlight{m-2-1}{m-2-1}%
\fillpatternch{m-1-2}{m-2-3}
\highlight{m-1-2}{m-1-2}
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}
\end{document}
In addition to the above, I wish to also generate a shape as per the following:
However, I cannot generate these 'L' shaped shapes that have an outline. All my examples require overlapping or multiple shapes which have rectangular outlines. Could anybody suggest a method to generate the type of shape in the picture?
Thanks