I'm trying to plot something which I thought was very simple:


But this exact line in my plot doesn't work:


The error that I receive is:

Missing number, treated as zero.
<to be read again> 
l.41 \addplot[draw=red]{sin(deg(ln(x)))};

Is there a simple solution?

  • Could you edit your question to include a complete minimal example document that reproduces the error? At the moment, it's impossible to tell what the problem is. That code line looks fine.
    – Jake
    Apr 7 '16 at 20:03
  • @Jake sorry I didn't include a complete example. Since plotting other functions worked, I assumed (wrongly) that the problem was in my syntax. The answer below got it right with the domain problem though. Thanks for commenting!
    – Abe Fehr
    Apr 7 '16 at 21:21

The default domain is -5 to 5, so you're likely trying to calculate the logarithm of negative numbers.


enter image description here

  • That's exactly the problem, but I was convinced that my syntax was wrong because it only failed when I put those functions together. Thank you so much for the solve!
    – Abe Fehr
    Apr 7 '16 at 21:18

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.