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

I'm trying to draw a frequency modulated sinusoidal in a polar domain with the following code.





    \draw [domain=0:6.29,samples=500,smooth] plot (xy polar cs:angle=\x r,
        radius={\rad+\amp*cos(\n*\x r+sin(\n*\x r+\myphi)+\myphi)});



When I compile this, however, the inner sinusoidal is completely ignored. In other words, tikz seems to read the following line instead.

radius={\rad+\amp*cos(\n*\x r+\myphi)});

Why does this happen, and how do I get the intended result?

Edit: Frequency modulation is a mathematical operation which modifies the argument of a function. In my example, the argument of the cosine function is modified by a sine function. As explained, this inner sine function is, for some reason, ignored when I compile the code. I'm curious about why, and I wish to know how I can draw a function where nothing is ignored.

Visualized by Wolfram Alpha, the first image shows the intended function, and the second image shows the function LaTeX compiles. They are not the same.

Edit2: I have shortened and changed the example. It should now be easier to read the function in the code above. Hopefully I didn't remove anything essential.

enter image description here enter image description here

share|improve this question
All users are not familiar with frequency modulated sinusoidal graph. What do produce your code? Please give us an example. – ferahfeza Apr 2 '14 at 22:04
Consider using PGFPlots for doing polar plots: tex.stackexchange.com/questions/146671/… – juliohm Apr 2 '14 at 22:12
I included the two images of the two figures you linked to. They seem identical to me and identical to the function I get running your MWE (just missing the axis). – Peter Grill Apr 2 '14 at 23:29
@Peter, by removing the Wolfram Alpha (WA) links, you also removed the expressions as shown in WA, which should indeed make it clearer that they are not the same. – eiterorm Apr 2 '14 at 23:35
Have added the links back. Sorry about that. It was difficult for me to see the difference without having them on the same page, and including the images here seems to show that they are same graph. – Peter Grill Apr 2 '14 at 23:36
up vote 4 down vote accepted

I don't think there's anything wrong with tikz. It seems that you have forgotten a r in the formula (to interpret your angle as radians and not degrees):

\draw [domain=0:6.29,samples=500,smooth] plot (xy polar cs:angle=\x r,
       radius={\rad+\amp*cos(\n*\x r+sin(\n*\x r+\myphi) r+\myphi)});

It is precisely the last r appearing on the second line.


share|improve this answer
That solved it all. Thanks a lot. – eiterorm Apr 3 '14 at 0:18

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.