Here is a little bit advanced but not so difficult to understand grid construction:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\clip (0,0) rectangle (10cm,10cm); % Clips the picture...
\pgftransformcm{1}{0.6}{0.7}{1}{\pgfpoint{3cm}{3cm}} % This is actually the transformation
% matrix entries that gives the slanted
% unit vectors. You might check it on
% MATLAB etc. . I got it by guessing.
\draw[style=help lines,dashed] (-14,-14) grid[step=2cm] (14,14); % Draws a grid in the new coordinates.
\filldraw[fill=gray, draw=black] (0,0) rectangle (2,2); % Puts the shaded rectangle
\foreach \x in {-7,-6,...,7}{ % Two indices running over each
\foreach \y in {-7,-6,...,7}{ % node on the grid we have drawn
\node[draw,circle,inner sep=2pt,fill] at (2*\x,2*\y) {}; % Places a dot at those points
}
}
\end{scope}
\end{tikzpicture}
\end{document}
Here is the output:
If you combine it with Peter's code it would be almost ready. Note that there is a scope environment around my code that keeps the transformation local to that scope. Cehck the manual for some intuition about the command \pgftransformcm
Best Answer
You need to add
\usepackage{pgfplots}
to your preamble. In LyX, you can edit the preamble underDocument | Settings | LaTeX Preamble
.