Draw arrow not to node center but to edge of circle on this node?

This example:

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}%
\draw[help lines] (0,0) grid (1,1);

\node [draw, circle] at (0,0) {};
\node [draw, circle] at (1,1) {};

\draw[->] (0,0) -- (1,1);
\end{tikzpicture}
\end{document}


plots two circles. But the arrow starts in the one circle and ends in the other circle. What I need is: starting and ending on the radius of the two circles.

How is this possible? Best if it is done automatically/dynmically depending on the size of the circles.

-
In this example, you're not actually using PGFPlots, but only TikZ/PGF. PGFPlots is a plotting environment that uses TikZ/PGF (and loads it automatically). I've edited the tags accordingly. – Jake Jan 8 '13 at 16:08
Ah, thanks for that. :) I always don't really know the difference between these two and which command comes from what package actually in the end. ;) – Foo Bar Jan 8 '13 at 16:09
But what about drawing dotted lines, i.e. \draw[dotted] (c1) -- (c2) because then there is no automatism. Any idea? – user64975 Oct 24 '14 at 20:31

Use named nodes. They do that automatically.

To name nodes, use either

• the name=<name> key, or
• the special syntax (<name>) (see example below)

Code

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}%
\draw[help lines] (0,0) grid (1,1);
\node [draw, circle]          (c1) at (0,0) {};% special syntax
\node [draw, circle, name=c2]      at (1,1) {};% name key
\draw[->] (c1) -- (c2);
\end{tikzpicture}
\end{document}


Output

-
Wow, thanks. Life can be so easy if you just know that something exists. :) Will accept this answer when the wait time is over. – Foo Bar Jan 8 '13 at 16:07