1

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.

Keba
  • 581

0 Answers0