3

I want to draw a parabola with TikZ. Below is a minimal example, which gives me the error Cannot parse this coordinate at the last \draw line. If I remove the bend part, I do not get this error.

What did I do wrong?

\documentclass{article}
\usepackage{fontspec}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \draw (0, 0) parabola bend (3, 4);
\end{tikzpicture}
\end{document}
  • 1
    The parabola bend operation needs two coordinates at the end. See page 154 and 155 of the PGF manual. – Max Jul 19 '18 at 10:57
  • That's it, thanks! If you submit it as an answer, I will accept it. – red_trumpet Jul 19 '18 at 11:28
5

The parabola bend operation needs three coordinates in total, one before it to define the start point, and two after it to define the bend location and the end point.

Some other uses of the parabola operation are (taken from the pgf manual, page 155):

\documentclass[tikz,margin=2mm]{standalone}

\begin{document}
    \begin{tikzpicture}
    \draw               (0,0) rectangle                (1,1.5)
                        (0,0) parabola                 (1,1.5);
    \draw[xshift=1.5cm] (0,0) rectangle                (1,1.5)
                        (0,0) parabola[bend at end]    (1,1.5);
    \draw[xshift=3cm]   (0,0) rectangle                (1,1.5)
                        (0,0) parabola bend (.75,1.75) (1,1.5);
    \draw[xshift=4.5cm] (1,1.5) --
                        (0,0) parabola                 cycle;
    \end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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