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

So I am trying to create a plot of an astroid in pgfplots which has the parameterization x = cos(t)^3 y= sin(t)^3 and tikz is giving me an error that it is giving up on a path and wondering if I forgot a semicolon, but I did not.

Any ideas of how I can fix this? Any help is appreciated.





\begin{axis}[axis x line =middle, axis y line = middle,thick, smooth]
    \addplot[domain=0:2*pi](cos(deg(x)),x);  %this line works like a charm
    \addplot[domain=0:2*pi](x,sin(deg(x)));  %this line does not work
    \addplot[domain=0:2*pi]((cos(deg(x)))^3,(sin(deg(x)))^3); %goal

share|improve this question
use {} : \addplot[domain=0:2*pi]({cos(deg(x))^3},{sin(deg(x))^3}) ; – Vincent Nivoliers Jun 3 '14 at 15:44
@VincentNivoliers yes that worked exactly! why does it need braces here when other parameterizations don't? – ian Jun 3 '14 at 15:47
from the manual, page 53, it has to do with the fact that you use round braces in the expression, and that round braces are already used to enclose the list of coordinates. This is therefore probably due the the parser used for mathematical expressions. – Vincent Nivoliers Jun 3 '14 at 15:55
@VincentNivoliers, please convert your comment to an answer if it has resolved OP's problem. – Pouya Jun 3 '14 at 20:36

You should use {} : \addplot[domain=0:2*pi]({cos(deg(x))^3},{sin(deg(x))^3}) ;

As said in the comments, this seems to be due to the handling of round braces by pgfplot. See the manual page 53.

share|improve this answer

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.