TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This example:



    \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);

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.

share|improve this question
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
up vote 14 down vote accepted

Use named nodes. They do that automatically.

To name nodes, use either

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


    \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);


enter image description here

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.