[Tex/LaTex] TikZ Grid Without Edges

gridstikz-pgf

I have the following TikZ grid:

Current Output

But I'd like to draw the grid without edges, or with half of the edges cells missing, so that it appears to be a small section of a larger, infinite grid. What's the best way to achieve this?

\documentclass[border=0.25cm]{standalone}
\usepackage{tikz}
\begin{document}
  \begin{tikzpicture}
    \draw[step=0.5cm,color=gray] (0,0) grid (3.5,3.5);
  \end{tikzpicture}
\end{document}

Best Answer

If you make the coordinates not an exact multiple of the step size you can get this effect:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
   \draw[step=0.5cm,color=gray] (.75,.75) grid (3.75,3.75);
\end{tikzpicture}
\end{document}

output of code