JL Diaz | 6 Apr 2012 13:26
Picon

Re: Positions within a node

You can redefine x and y vectors as the dimensions of the image, but that would produce a different scale in the x and y axes.


I prefer to define both x and y as the image width. This way, (0,0) represents the lower left corner, (1,0) the lower rigth corner and (1,1) the corner of a square whose base is the base of the rectangle containing the image.

Plotting a grid on top of the image is useful to guess the coordinates of different points inside.

Here is an example of all this:

\documentclass{minimal}\usepackage{nopageno}
\usepackage{tikz}
\usepackage{graphicx}

\def\mywidth{10cm}  % Width of the image 

\begin{document}
\begin{tikzpicture}[x=\mywidth,y=\mywidth]
 \draw (0,0) node[anchor=south west, inner sep=0pt] (Image) {\includegraphics[width=\mywidth]{Image}};

% Grid as a guide
 \draw[color=yellow!60!black] (0,0) grid[step=0.01] (Image.north east);
 \draw[color=white] (0,0) grid[step=0.1] (Image.north east);

% Draw a "big dot" on top of the image
 \fill[green] (0.44, 0.35) circle (2pt);
\end{tikzpicture}
\end{document}

Saludos,
--JL Diaz

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users

Gmane