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

1 Answer 1

2

You're missing a multiplication symbol; you need:

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

enter image description here

1
  • Thank you! Very simple solution but it worked :)
    – black
    Nov 14, 2016 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .