5
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{3d,calc}
\usetikzlibrary{calc}


\begin{document}
 \begin{tikzpicture}
  \draw[domain=0:2*3.14159265] plot (xy polar
cs:angle=\x r,radius={2 -sin(4\x r)});
 \end{tikzpicture}

\end{document}

this is the example I am using, where I want to plot $$r =2 - \sin(4\theta)$$ in the [0:2*pi] range. here for example one can see the correct plot. What am I missing?

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Andrew Swann May 21 '14 at 12:30
5

You have to explicitly multiply the 4 and the \x r using *, otherwise you're just concatenating the strings:

\documentclass{article}
\usepackage{tikz}


\begin{document}
 \begin{tikzpicture}
  \draw[domain=0:2*pi, samples=100, smooth] plot (xy polar
cs:angle=\x r,radius={2 -sin(4*\x r)});
 \end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.