I want to draw with TikZ a curve, knowing its parametric equations.

The curve is given by:

$\gamma :\left\{
x=t, \\
y=t^{2}, \\
\right. t\in \left[ 0,1\right] .$

Which would be the code for this plotting?

  • See the pgfplots package that builds on tikz and deals specifically with plotting. The documentation contains several examples of this type. – Andrew Swann Dec 3 '17 at 8:40

You can do it either TikZ or pgfplots way

In TikZ

\draw[domain=0:1,smooth,variable=\t]plot (\t,\t^2,\t^3);

In pgfplots

    \begin{axis}[samples y=0]
        \addplot3+[domain=0:1] (x,x^2,x^3);


enter image description here

The extra option is due to Artificial Line in PGFPlots 3D Parametric Plots?


Here is a working example for your requirements.




            legend pos= north west,

            \addplot +[smooth,thick]{x};
            \addlegendentry{$x=t$ }

            \addplot +[smooth,thick] []{x^2}; %Linear regression 1st order 1984-2017
            \addlegendentry{$y=t^2$ }

            \addplot +[smooth,thick] []{x^3}; %Linear regression 1st order 1984-2017
            \caption{Your caption}


OUTPUT:: enter image description here

  • @Cris if this answers your question please mark it as answered. Thank you. – Sari Dec 3 '17 at 10:06
  • I have already marked both answers. – Cris Dec 3 '17 at 15:11
  • you can mark it with the check mark sign not upvote :). – Sari Dec 3 '17 at 15:13
  • Done :) I finally found it :) – Cris Dec 3 '17 at 18:47

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.