Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I "placed" some nodes on a circular path but they aren't showing up in the correct place and they aren't even on the circle.

What is going wrong?

enter image description here

\begin{document}

\usepackage{tikz, pgfplots}

\usetikzlibrary{arrows, decorations.markings, calc, fadings,  decorations.pathreplacing, patterns,decorations.pathmorphing, positioning}

\begin{document}
\begin{center}
   \begin{tikzpicture}[line join = round, line cap = round, >=triangle 45]
     \filldraw[blue, opacity = .3] (0,0) circle (2cm);
     \draw[dashed] (-4,0) -- (5,0);
     \begin{scope}[decoration = {markings, mark = at position 0.25 with {\arrow{>}},
       mark = at position 0.75 with {\arrow{>}},
       mark = at position 0.2 with {\node[draw, circle, inner sep = .05cm, fill = white
       , scale = .75] {1};}, }]
       \draw[postaction = decorate] (0,0) circle (2.5cm);
       \filldraw[black] (2.5,0) circle (.05cm);
       \node[scale = .75] at (2.7,.2) {$A$};
     \end{scope}
     \begin{scope}[decoration = {markings, mark = at position 0.25 with {\arrow{>}},
       mark = at position 0.75 with {\arrow{>}},
       mark = at position 0.2 with {\node[draw, circle, fill = white, inner sep = .05cm, scale = .75]
       {2};},
       mark = at position 0.35 with {\filldraw[black] circle (.05cm);}, } ]
       \draw[postaction = decorate] (0,0) circle (3.75cm);
     \end{scope}
       \filldraw[black] (3.75,0) circle (.05cm);
       \node[scale = .75] at (3.95,.2) {$B$};
       \filldraw[black] (-3.75,0) circle (.05cm);
       \node[scale = .75] at (-3.95,.2) {$C$};
   \end{tikzpicture}
 \end{center}
 \end{document}
share|improve this question

1 Answer 1

up vote 8 down vote accepted

When using the mark option several times, positions should be given in ascending order:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings, calc, fadings,  decorations.pathreplacing, patterns,decorations.pathmorphing, positioning}

\begin{document}
\begin{center}
   \begin{tikzpicture}[line join = round, line cap = round, >=triangle 45]
     \filldraw[blue, opacity = .3] (0,0) circle (2cm);
     \draw[dashed] (-4,0) -- (5,0);
     \begin{scope}[decoration = {markings, 
       mark = at position 0.2 with {\node[draw, circle, inner sep = .05cm, fill = white,   scale = .75] {1};},
       mark = at position 0.25 with {\arrow{>}},
       mark = at position 0.75 with {\arrow{>}}
      }]
       \draw[postaction = decorate] (0,0) circle (2.5cm);
       \filldraw[black] (2.5,0) circle (.05cm);
       \node[scale = .75] at (2.7,.2) {$A$};
     \end{scope}
     \begin{scope}[decoration = {markings, 
       mark = at position 0.2 with {\node[draw, circle, fill = white, inner sep = .05cm, scale = .75] {2};},
       mark = at position 0.25 with {\arrow{>}},
       mark = at position 0.35 with {\filldraw[black] circle (.05cm);}, 
       mark = at position 0.75 with {\arrow{>}}
       }]
       \draw[postaction = decorate] (0,0) circle (3.75cm);
     \end{scope}
       \filldraw[black] (3.75,0) circle (.05cm);
       \node[scale = .75] at (3.95,.2) {$B$};
       \filldraw[black] (-3.75,0) circle (.05cm);
       \node[scale = .75] at (-3.95,.2) {$C$};
   \end{tikzpicture}
 \end{center}
 \end{document}

enter image description here

Quoting directly from Section 30.5 Arbitrary Markings (page 328) of the pgfmanual:

It is possible to give the mark option several times, which causes several markings to be applied. In this case, however, it is necessary that the positions on the path are in increasing order. That is, it is not allowed (and will result in chaos) to have a marking that lies earlier on the path to follow a marking that is later on the path.

share|improve this answer
    
so that is the issue only issue then? –  dustin Mar 30 '13 at 1:52
1  
@dustin yes; that was the problem. –  Gonzalo Medina Mar 30 '13 at 1:54

Your Answer

 
discard

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.