TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to position nodes on a parabola curve. However, it seems tikz cannot calculate the midway positions. Neither of the following examples works:

    \draw (-1,0) parabola[parabola height=2cm] (3,0)
        node[sloped, above, pos=0.5] {0.5};

\begin{tikzpicture}[to path={
    parabola[parabola height=2cm] (\tikztotarget) \tikztonodes}]
    \draw (0,0) to
        node[above, sloped] {0.5} (3,0);

Any suggestions? Thanks!

share|improve this question
You can format your code examples by selecting the code and clicking on the 101 icon. I fixed this for you. – Alan Munn Jan 16 '11 at 4:31
Thanks! Alan. I will keep it in mind next time. – ltxsun Jan 16 '11 at 6:39
up vote 2 down vote accepted

From the TikZ manual (section 16.8 “Placing Nodes on a Line or Curve Explicitly” in v2.10):

In the simplest case, the previous path operation was a “line-to” operation, that is, a -- coordinate operation [...]

The next case is the curve-to operation (the .. operation). [...]

Another interesting case are the horizontal/vertical line-to operations |- and -|. For them, the position (or time) 0.5 is exactly the corner point. [...]

For all other path construction operations, the position placement does not work, currently. This will hopefully change in the future (especially for the arc operation).

(emphasis mine)

So you either have to position the node by hand, or draw the parabola with an explicit Bézier curve.

share|improve this answer

Your Answer


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.