[pstricks] Plotting a function

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Jun 1 21:19:45 CEST 2008


Cosi Lein schrieb:

> @Herbert: a "unit-problem" seems plausible... But if I use your
> suggestion, I get a line instead of my function? 

sure, it depeneds to your chosen interval for x

> The function is a profit function (reverse parabola) with a maximum in
> (x=60.000, y=18.000.000) and two roots in x=0 and x=120.000 - so I need
> these large scales. How can I generate these scales? (I suspect it's
> very easy, but I don't see solution...)

the root is not 0 because f(0)=-20000

\documentclass{article}
\pagestyle{empty}
\usepackage{pstricks-add}
\def\pshlabel#1{$#1\cdot 10^3$}
\def\psvlabel#1{$#1\cdot 10^6$}
\begin{document}

\noindent
\begin{pspicture}(-2,-1.5)(13,9.5)
\psaxes[dx=2cm, dy=1cm,
	Dx=20,Dy=2,ticksize=-2pt,
	linewidth=0.7pt]{->}(0,0)(12.5,9)
\psplot[linewidth=1pt,linecolor=red,
	algebraic,xunit=0.1,plotpoints=1000]{0}{120}%
	{(-0.005*(x*1000)^2+600*(x*1000)-20000)/2000000}
%\psdot(*60 {-0.005*x^2+600*x-20000})
\end{pspicture}

\end{document}


Herbert



More information about the PSTricks mailing list