答案1
我们将设置一个sparsity diagram
样式来设置适当的缩放比例坐标坐标系,绘制大矩形,并设置图表的基线,以便它们与操作员大致对齐。
然后我们只需绘制矩形并填充它们。
代码
\documentclass{article}
\usepackage{tikz}
\tikzset{
sparsity diagram/.style={
execute at begin picture={\draw(0,0)rectangle coordinate (midway) (3,3);},
x=+5mm, y=+5mm, baseline={([yshift=+-.5ex]midway)}}}
\begin{document}
\[
\tikz[sparsity diagram]{
\draw[fill=gray!50] (1,0) -| (3,2) -| coordinate (@1)
(2,3) -| (0,1) -| coordinate (@2) cycle;
\draw[dashed] (@1) rectangle (@2);
}
=
\tikz[sparsity diagram]
\draw[fill=gray!50] (0, 3) rectangle node {$H_{\beta_1}$} + (2,-2);
+
\tikz[sparsity diagram]
\draw[fill=gray!50] (1, 0) rectangle node {$H_{\beta_2}$}+ (2,2);
\]
\end{document}