5

Could you help me make the code to draw a sloped gride like the image below in TikZ?

enter image description here

Mancala
  • 185
  • Here is a similar problem where the solution also applies if you want your grid to be not rotated, but skewed. http://tex.stackexchange.com/questions/198352/tikz-how-to-apply-an-affine-transformation – Robin Ekman Jun 05 '16 at 21:52

1 Answers1

12

This draws a single grid, rotated by 45 degrees, with open lines at the outer boundary, with blue lines, the step is 0.5 units, by constructing a grid path.

If the grid boundary should be drawn, make sure the grid interval boundaries are integer multiples of the step size, say (2.5,2.5) grid (2.5,2.5), for example (not shown here, although)

The second example is just for fun: Drawing a bunch of rotated grids.

\documentclass{book}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw[step=0.5,blue,rotate=45] (-2.4,-2.4) grid (2.4,2.4);
\end{tikzpicture}

\begin{tikzpicture}
\foreach \x in {10,20,30,45,50,60,70,80} {
\draw[step=0.5,blue,rotate=\x] (-2.4,-2.4) grid (2.4,2.4);
}
\end{tikzpicture}
\end{document}

enter image description here