5

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

enter image description here

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

  • @NetinhoSantos: You're welcome. Please add some starter code in future. Happy TeXinG! – user31729 Jun 5 '16 at 18:48
  • Why writing scale=1? I think that's the default. – Alenanno Jun 5 '16 at 18:57
  • @Alenanno: Ooops, that's the remainder of old code. I'll remove it. Thanks! – user31729 Jun 5 '16 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.