Despite having read answers to 4-5 relate questions, I still can't get why my code does not compile. Here it is:
\documentclass[11pt,twoside]{book}
\usepackage[paperheight=24cm, paperwidth=35cm, margin=0pt, %
voffset=-50cm, hoffset=-1.4cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\pagestyle{empty}
\begin{figure}[!h]
\centering\begin{tikzpicture}[xscale=1,yscale=1]
\draw[very thick,yellow,samples=500,domain=-6*pi:6*pi]
plot (\x, {cos((3*\x r)+pi/2)+\x*sin(3*\x r)});
\draw[very thick,orange,samples=500,domain=-6*pi:6*pi]
plot (\x, {-0.25*(pow(\x,2)*cos(\x r)-\x*sin(\x r))});
\draw[very thick,green,samples=500,domain=-6*pi:6*pi]
plot (\x, {cos(\x r)+\x});
\draw[very thick,magenta,samples=500,domain=-6*pi:6*pi]%% error!
plot (\x, {0.5*(pow(10,-11)*exp(-3*\x)-cos(\x r)+3*sin(\x r))});%% error!
\draw[very thick,blue,samples=500,domain=-6*pi:6*pi]%% error!
plot (\x, {pow(10,-15)*exp(3*\x)});%% error!
\end{tikzpicture}
\end{figure}
\end{document}
The latest two of five plots – as I showed in comments – are driving me mad.
Please notice the massive voffset
too. Is it related?
Obviously I tried several local modifications (e.g. radiants, etc.).
This was just a test but now I'm seriously curious.
Best Answer
Percusse has answered accordingly to the question. (I think his answer should be marked as "accepted", by the way). I took the liberty to propose a MetaPost solution, however.
Until quite recently, this kind of function drawing would have been impossible to do with MetaPost, since it was based only on quite limited fixed-point numerics. But since its version 1.8 the user can switch to floating-point numerics at will, by setting the internal variable
numbersystem
todouble
. It's still a bit rough around the edges (the default units has not yet been adapted, for example) but it's quite functional, and I couldn't resist to use it for this problem. The following program makes use of LuaLaTeX and itsluamplib
package as a very convenient interface to MetaPost. It calls the Metafun format of MetaPost, which defines the necessary auxiliary functions (cos, sin, exp…)