2

I want to plot a parabola and use therefore the following code:

\usepackage{pst-plot}
\usepackage{pst-math}
%...
\begin{pspicture}(-2,-3.5)(6,3)
     \psgrid[griddots=10,gridlabels=0pt,subgriddiv=0,gridcolor=black!20]
     \psaxes(0,0)(-2,-3.5)(6,3)
     \psset{algebraic,linewidth=1.5pt}
     \psplot[linecolor=red]{-1}{5}{-0.5(x-2)^2+2}
\end{pspicture}

But I get this wrong function plotted. I can't find my mistake. What is wrong?enter image description here

2

You're missing a multiplication symbol; you need:

\psplot[linecolor=red]{-1}{5}{-0.5*(x-2)^2+2}
%                                 ^

enter image description here

  • Thank you! Very simple solution but it worked :) – black Nov 14 '16 at 17:44

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.