Possible Duplicate:
Simplest way to overlay a text + rectangle label an image?
Drawing on an image with TikZ
I read the following in the TikZ manual:
There are different ways of specifying coordinates. The easiest way is to say something like (10pt,2cm). This means 10pt in x-direction and 2cm in y-directions. Alternatively, you can also leave out the units as in (1,2), which means “one times the current x-vector plus twice the current y-vector.” These vectors default to 1cm in the x-direction and 1cm in the y-direction, respectively.
Say I have an image and that I want to overlay stuff on it. Is there a way to set up coordinates that are normalized to the size of the figure?
For example say I want to place a picture image.png within a tikzpicture
\begin{tikzpicture}[inner sep=0pt,remember picture]
\node at (0,0) {\includegraphics[width=0.8\linewidth]{image.png}};
\end{tikzpicture}%
I would like to use normalized coordinates when drawing nodes on top of it, such that I have the following reference frame:
0 1
. -------------------> X
| |
| |
| Figure |
| |
| |
1 | -------------------
V
Y
In other words I would like to have (1,1) refer to the bottom right corner, and (0,0) refer to the upper left corner of the figure (or image).
-for theyvalue to get this axis downwards. We were planning to produce a package for this, btw. – Martin Scharrer Apr 24 '12 at 19:22cm, not as normalized coordinates with respect to the content of thetikzpictureenvironment. – Amelio Vazquez-Reina Apr 24 '12 at 19:43x={(image.south east)},y={(image.north west)}do in Drawing on an image with TikZ. – Jake Apr 24 '12 at 19:45(<unitless number>,<unitless number>)always referenced to the unit vectors. These simply happen to have an default value of1cm, which can be easily changed, even locally. – Martin Scharrer Apr 24 '12 at 19:49anchor=south westwithanchor=north west, andx={(image.south east)},y={(image.north west)}withx={(image.north east)},y={(image.south west)}. – Jake Apr 24 '12 at 19:52