Take the 2-minute tour ×

I want to write a macro that uses TikZ to create a photo like this:


But, finally I came up with something like this:

TikZ Picture

As you see, the problem is that the arrows go to the wrong side of the end circle (they always go to the right side). Here is the source code of my example:


\begin{tikzpicture}[every node/.style={align=center}]  

\foreach \gritem [count=\xi] in {#1}  {\global\let\maxgritem\xi}  

     ultra thick,
     fill opacity=.5,
     minimum size=3cm] (satellite\xi) at (\angle:4cm) {\gritem };

\pgfmathsetmacro{\xj}{mod(\xi, \maxgritem) + 1}
\draw[<-,line width=.5cm,opacity=.5,\col] (satellite\xj) to[bend left] (satellite\xi);


\graphitemize{Phase 1,Phase 2, Phase 3, Phase 4}


Note that I adapted the code from Altermundus answer to this question. How can I fix the end position of the arrows?

share|improve this question
You should wrap your \draw command for the arrows in \begin{scope}[opacity=.5,transparency group] ... \end{scope} to make sure that the arrow lines and arrow tips have the same colour. Also, note that fill opacity=0.5 also makes the text semitransparent in your nodes, so you should set text opacity=1 after fill opacity. Lastly, if there are no objects behind the graph, you might as well just choose lighter colours, instead of using transparency. –  Jake Apr 23 '12 at 8:20
Indeed, instead of opacity=.5,\col you can use \col\relax!0.5. –  percusse Apr 23 '12 at 8:21
I don't know if we have a canonical "What are legal TikZ node names" or not, but maybe we should! In the meantime, here's a similar situation: tex.stackexchange.com/a/28242/86 –  Andrew Stacey Apr 23 '12 at 8:29
@AndrewStacey I read percusse's answer after your comment :( –  Alain Matthes Apr 23 '12 at 8:59
add comment

1 Answer

up vote 11 down vote accepted

The problem comes from the math operation mod(\xi, \maxgritem) + 1. TikZ is giving the result with a number with decimal point such as 1.0, 2.0 etc. and later since you use it in the node naming it becomes satellite1.0,satellite2.0. Coincidentally, this means that the arrow shoud go to the node border at zero angle, hence the weird right side tracking.

You can fix it easily by replacing the operation line with

\pgfmathtruncatemacro{\xj}{mod(\xi, \maxgritem) + 1)} 
share|improve this answer
add comment

Your Answer


