I want to draw some interpolation curves and came across the following command
\draw plot[smooth] coordinates {(1,1) (4,8) (6,3) (8,9)};
That seems quite nice. Now I wanted to add some labels and found some information here (Labeling a function's plot generated by “plot function”) and here (How to label a path drawn using tikz with \draw plot?)
Now my solution looks like:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[label/.style={postaction={decorate,
transform shape,
decoration={markings,mark=at position 0.5 with \node #1;}}}]
\draw[help lines] (0,0) grid (10,10);
\draw[->,label={[above]{1}}] plot[smooth] coordinates {(1,1) (4,8) (6,3) (8,9)};
\end{tikzpicture}
\end{document}
Everything seems to work, but at one point I get an error I can't understand or solve. If I change mark=at position to a value less than 0.4 it still produces the desired output, but gives me the following error messange.
! Dimension too large.
<to be read again>
\relax
l.10 ...th] coordinates {(1,1) (4,8) (6,3) (8,9)};
! Dimension too large.
<recently read> \pgfmath@x
l.10 ...th] coordinates {(1,1) (4,8) (6,3) (8,9)};
! Dimension too large.
<to be read again>
\relax
l.10 ...th] coordinates {(1,1) (4,8) (6,3) (8,9)};
Any ideas what's going on there or how to solve it? Thanks a lot.

pgfplots? – Johannes_B Mar 03 '14 at 15:20\listfilesin your very first line, and have a look into the log file afterwards. The recent version of tikz/pgf is 3.0 – Johannes_B Mar 03 '14 at 15:23pos=0.9). – Claudio Fiandrino Mar 03 '14 at 15:23pos=0.2? – stephan boehme Mar 03 '14 at 15:51pos=0.2– stephan boehme Mar 03 '14 at 16:28position=<value>for any non negative<value>less than0.39(using version 3.0 of PGF). – Gonzalo Medina Mar 03 '14 at 17:30smoothanddecorate. You have two options (as work around): put another point close to(1,1)or removesmooth. – Mar 03 '14 at 23:31