[Tex/LaTex] Draw grid on writable area with tikz

tikz-pgf

I wish to draw below image on A4 paper with tikz.The grids should be cover all writable area.

enter image description here

I have searched it on many site but still not figure out how to do it with tikz.

Best Answer

You also can use pgfplots for this.

Code

\documentclass[a4paper]{article}
\usepackage[margin=1cm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{pgfplots}


\begin{document}
\thispagestyle{empty}
\pgfplotsset{minor grid style = {dashed, Green}}
\pgfplotsset{major grid style = {solid, Green}}
    \begin{figure}\centering
        \begin{tikzpicture}[Green]
        \begin{axis}[grid = both,
                     ticks = none,
                     minor tick num = 1,
                     xmin = 0,
                     ymin = 0,
                     xmax = 17,
                     ymax = 26,
                     width = 17cm,
                     height = 26cm,
                     scale only axis]
        \end{axis}
        \end{tikzpicture}
    \end{figure}
\end{document}

enter image description here

Update

If you want a 2cm separation on grid, one thing you can do is to use ytickand xtick options, as follows:

     \begin{axis}[grid = both,
                 ticks = none,
                 minor tick num = 1,
                 xmin = 0,
                 ymin = 0,
                 xmax = 16,
                 ymax = 26,
                 xtick = {0, 2,..., 16},
                 ytick = {0, 2,..., 26},
                 width = 16cm,
                 height = 26cm,
                 scale only axis]
    \end{axis}