How can I draw a grid similar to the one below in the question answer?
But I can select different fill colors for the separate cells?
I need to be able to color (fill) in the separate nodes in the grid. I tried using this, but for some reasons there's some weird padding on the fill
\documentclass{article}
\usepackage{algorithmic}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{tikz}
\title{Title}
\author{User}
\begin{document}
\begin{tikzpicture}
\draw[step=0.5cm,color=black] (-1,-1) grid (1,1);
\node[fill=green] at (-0.75,+0.75) {};
\node at (-0.25,+0.75) {};
\node at (+0.25,+0.75) {};
\node at (+0.75,+0.75) {};
\node at (-0.75,+0.25) {};
\end{tikzpicture}
\end{document}
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.