Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\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?

enter image description here

share|improve this question
    
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

1 Answer 1

What about using a node instead?

\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}

enter image description here

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.