# TikZ: Why would a decoration cause a dimension too big?

\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}

\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\begin{document}
\tdplotsetmaincoords{60}{130}
\begin{tikzpicture}[tdplot_main_coords]
\coordinate (O) at (0, 0, 0);

\draw[-latex] (O) -- (4, 0, 0) node[pos = 1.1, font = \scriptsize] {$$x$$};
\draw[-latex] (O) -- (0, 4, 0) node[pos = 1.1, font = \scriptsize] {$$y$$};
\draw[-latex] (O) -- (0, 0, 4) node[pos = 1.1, font = \scriptsize] {$$z$$};

\begin{scope}[decoration = {markings,
mark = at position 0.15 with {\node[font = \scriptsize, above] {C};}
}]
\draw[blue, name path = sc] plot[smooth] coordinates
{(-3, -3, 1) (-1, 1, 2.5) (2, 5, 1.5) (3, 5, 0)};
\end{scope}
\end{tikzpicture}
\end{document}


When I add postaction = decorate to my blue path, I get a dimension too large error. Since the pos = option doesn't work with plot, what can I do correct this issue here?

-
It seems only to affect the first part of the path and then only certain values. pos=.10 works while .11, .12, …, .21 don’t (with a variable number of error messages). Decorations and (especially smooth) plots both use very tricky things (dividing the path up in very short parts, measuring the path length). Does it need to be .15? – Qrrbrbirlbel Aug 28 '13 at 22:52
@Qrrbrbirlbel no but shouldn't this be fixed? – dustin Aug 28 '13 at 22:54
pos=... syntax is fixed in the CVS version. This error almost always comes from divide by zero (or a very small number) operations either during tangent computations or very small distances. It's more probable that 3D coord system is the culprit here. – percusse Aug 29 '13 at 5:35

\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}

\usetikzlibrary{decorations.markings}
\usetikzlibrary{intersections}

\begin{document}
\tdplotsetmaincoords{60}{130}
\begin{tikzpicture}[tdplot_main_coords]
\coordinate (O) at (0, 0, 0);

\draw[-latex] (O) -- (4, 0, 0) node[pos = 1.1, font = \scriptsize] {$$x$$};
\draw[-latex] (O) -- (0, 4, 0) node[pos = 1.1, font = \scriptsize] {$$y$$};
\draw[-latex] (O) -- (0, 0, 4) node[pos = 1.1, font = \scriptsize] {$$z$$};

\begin{scope}[decoration = {markings,
mark = at position 0.15 with {\node[font = \scriptsize, above] {C};}
}]
\draw[blue, name path = sc] plot[smooth] coordinates
{(-3, -3, 1) (-1, 1, 2.5) (2, 5, 1.5) (3, 5, 0)};
\draw (-3, -3, 1) node[above=-1.5bp]{$c$};
\end{scope}
\end{tikzpicture}
\end{document}


-
Because I don't want to play the guessing game on where to put the node. – dustin Aug 29 '13 at 19:20
You could replace the node code by \node at (-3, -3, 1 ) [above=-1.5bp] {$c$}; (This won’t help @dustin, anyway …) – Tobi Aug 29 '13 at 21:34