I am trying to recreate below table in tikz (I need because I could use tikz in my jupyter notebook to render embedded output but not yet latex)
When I try via tikz I only get this far..
My MWE:
\begin{tikzpicture}
\tikzset{square matrix/.style={
matrix of nodes,
column sep=-\pgflinewidth, row sep=-\pgflinewidth,
nodes={draw,
minimum height=#1,
anchor=center,
text width=#1,
align=center,
inner sep=0pt
},
},
square matrix/.default=1.2cm
}
\matrix[square matrix]
{
1 & & & & & & \\
2 & x & & & & & \\
3 & x & x & & & & \\
4 & x & x & x & & & \\
5 & x & x & x & x & & \\
6 & x & x & x & x & x & \\
};
\end{tikzpicture}
Best Answer
Sebastiano provided the solution for missing cells and how to fill each one, but it's also possible to define
styles
for complet rows and columns. And with some extra works draw the top left cell.Update:
To obtain some special color distribution like in your link
you can mix some automating filling for regular rows and columns and some manual filling on background:
2nd Update:
You could construct an automatic solution: