I want to plot a function containing a (converging) series. To plot this function I changed the series to a finite sum.
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
domain = 0:1,
samples = 501,
]
\addplot+[mark = none] gnuplot[raw gnuplot] {%
set samples 501;
dist(x) = x - floor(x) < 0.5 ? x - floor(x) : 1 - (x - floor(x));
plot[0:1] sum [k=0:5] (2^(-k) * dist(2^(2^k) * x))
};
\end{axis}
\end{tikzpicture}
\end{document}
If I do k=0:4, it works fine. But the example above I tried k=0:5 and although a plot is created this plot has nothing do to with my function.
If this question should not be asked on this stackexchange, please tell me where to open a new question.
gnuplot;2^(2^5)is2^32which could easily be out of its range of floating point arithmetic – Andrew Swann Jan 21 '14 at 14:40line 0: undefined variable: sum. Did I miss something? Is my gnuplot outdated? gnuplot 4.4 patchlevel 2 – Christian Feuersänger Jan 21 '14 at 18:54