5

This question already has an answer here:

The use of the option smooth in combination with the text decoration option gives the error "Dimension too large" Is this bug already known? What can I do? Short example code is given below.

\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{decorations.text}
\begin{filecontents}{data.txt}
7.06215e+08 4.023e+07
7.0587e+08  4.026e+07
7.1787e+08  4.002e+07
7.3473e+08  3.93e+07
7.52415e+08 3.873e+07
\end{filecontents}

\begin{document}
    \begin{tikzpicture}
        \begin{axis}[   xmin=680, xmax=940, ymin=30, ymax=110,  width = 0.5\linewidth,  ]

        \addplot+[smooth,draw = red ,mark=none,  
        decoration={text along path,    text={9 dB},raise=.5ex,text align={center}},  postaction={decorate}
        ] table[x expr= (\thisrowno{0}/1000000), y expr= (\thisrowno{1}/1000000),comment chars = !]{data.txt};      
        \end{axis}
    \end{tikzpicture}

\end{document}

enter image description here

marked as duplicate by Stefan Pinnow, Mensch, user13907, Zarko tikz-pgf Oct 30 '16 at 11:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    BTW: there seems to be an ) missing in your code to end the x expr. The dimension too large comes from the ymin, 'ymax, no idea why. – daleif Oct 7 '15 at 15:02
  • 1
    The error disappears as well if the text in the decoration is shortened, e.g. replacing 9 dB by 9. Don't know if that helps. – Chris Oct 7 '15 at 15:11

Browse other questions tagged or ask your own question.