I'm trying to plot roots of $(-1)^{n}$
. The code works fine
\documentclass[9pt]{article}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\def \n {7}
\begin{center}
\begin{tikzpicture}[scale=1.2,font=\tiny]
\begin{axis}[
axis x line=middle,
axis y line=middle,
domain=-8:8,
restrict y to domain=-8:8,
x=3cm,
y=3cm,
xmin=-1.5,
ymin=-1.5,
xmax=1.5,
ymax=1.5,
grid=both,
xtick={-3,-2.75,...,3},
ytick={-3,-2.75,...,3},
]
\addplot[smooth,blue,domain=0:2*pi,variable=\t]
({cos(t*180/pi)},{sin(t*180/pi)});
\foreach \k in {1,...,\n}{
\addplot[smooth,red,domain=0:1,variable=\t] (
{\t*cos(\k*360/\n)+(1-\t)*cos((\k+1)*360/\n)},
{\t*sin(\k*360/\n)+(1-\t)*sin((\k+1)*360/\n)}
);
\addplot[mark=none]
({1.1*cos(\k*360/\n)},{1.1*sin(\k*360/\n)})
node {\Large $w^{\k}$};
}
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
but it doesn't recognize this part
\addplot[mark=none] ({1.1*cos(\k*360/\n)},{1.1*sin(\k*360/\n)}) node {\Large $w^{\k}$};}