If you need to plot this function you can use this code:
\psset{yunit=0.5cm,xunit=1cm}
\begin{pspicture*}(-2.5,-2)(2.5,10)
\psaxes[Dy=2]{->}(0,0)(-2.5,-1)(2.5,10)
\psset{linewidth=1.5pt}
\psPolynomial[coeff=0 0 3]{-2.5}{5}
\rput[lb](1.6,4.2){$f(x)$}
\end{pspicture*}
You will need the package pst-func in your preamble. See the documentation.
----- Original Message -----
From: "voidie" <[email protected]>
To: <[email protected]>
Sent: Thursday, June 25, 2009 2:05 AM
Subject: How do i plot a function?
Hey dudes,
i would like to plot a simple function like f(x)=3x^2. I know there
are 2 ways of doing that. The first is to generate an image with an
external tool like gnuplot and include that image in the document
(Which i don't want to do). I would rather use a latex package so the
plot will be generated by data in have in the document. I have been
told i had to alter the latex preamble but is that possible at all? I
know there is a button to include Tex code but that's all.
Cheers!