0

How can we display rulers on the top and the side of a TikZ image? When creating a TikZ image, we need to place items (nodes, lines, etc.) at specific positions. It would be easier if we see the coordinates of any potential point by means of rulers (or is there a better way?) How can we place rulers in the TikZ image (they would be just for the time of development of the image)

cerebrou
  • 801

2 Answers2

1

TikZ has the help lines style for this purpose.

enter image description here

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture} \drawhelp lines grid (5,2); \draw (-.5,-.7) -- (4.3, 1.6); \end{tikzpicture}

\end{document}

Sandy G
  • 42,558
0

Something like this?

enter image description here

Code:

\documentclass[10pt,a4paper]{book}

\usepackage{tikz} %\usepackage{graphicx} \begin{document} \begin{tikzpicture} \draw[step=1cm,line width=1pt] (0,0) grid (11,12); \foreach \i in {1,2,...,11} \foreach \j in {1,2,...,12} \node at (\i-.5,\j-.5) () { \i,\j}; \node at (5,5) {\includegraphics[width=6cm]{example-image-duck}}; \end{tikzpicture} \end{document}

You can comment or delete the code for the grid after your work is finished.