# pgfplots - Nodes on polar curve r=1+cos(x)

I want to draw circles as node on polar curve r=1+cos(x) with equal intervals. I can draw one node on curve, say for 30 degree, using parametric equation of curve using code below.

\documentclass[margin=1cm]{standalone}
\usepackage{pgf,tikz,pgfplots}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usetikzlibrary{calc,arrows}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
axis equal image,
enlargelimits=true,
xlabel=$x$,
ylabel=$y$
]
\pgfmathsetmacro{\R}{1+cos(30)};%
\fill (30:\R) circle (2pt);
\end{axis}
\end{tikzpicture}
\end{document}


For others nodes, inserting using \foreach, I give errors as follows:

 \addplot[data cs=polar,orange,domain=0:360,samples=360,smooth, ultra thick] (x,{1+cos(x)});
\foreach \t in {0,10,20,...,360}
{
\pgfmathsetmacro{\R}{1+cos(\t)};
\fill (\t:\R) circle (2pt);
}


! Undefined control sequence.
\UseTextAccent ...up \@firstofone \let \@curr@enc
\cf@encoding \@use@text@en...
l.21 \end{axis}


How can I achive this? Thank you in advance.

• – Enrico Maria De Angelis Feb 12 '17 at 13:24
• @EnricoMariaDeAngelis, thank you. It got it. – ferahfeza Feb 12 '17 at 13:54
• @ferafeza, I added a more concise answer. If you even needed to add labels to each of the markes, I would still try to rely on pgfplots tools before falling back on tikz's unrivaled power. – Enrico Maria De Angelis Feb 12 '17 at 14:05

By the way, an even more concise way of doing what you want is to rely on another addplot with only marks, mark=*, black, and samples=36 options, as follows.

\documentclass[margin=1cm]{standalone}
\usepackage{pgf,tikz,pgfplots}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usetikzlibrary{calc,arrows}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
axis equal image,
enlargelimits=true,
xlabel=$x$,
ylabel=$y$
]