[pstricks] psplot and smart numerical usage (memory exceed, buffer underflow?)

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Dec 13 19:01:44 CET 2009


Am 13.12.2009 15:01, schrieb lego at wh10.tu-dresden.de:

>   I want to plot the function given (by German law):
> http://www.gesetze-im-internet.de/estg/__32a.html
>   that concludes the income-tax-rate in dependence of your
> wage-befor-taxes (Bruttoeinnahmen). Since this is a very "interesting"
> way to define a formular, I simply want to draw this. The beginning was
> fine, I figured out how to scale the axes, redefine the units in order
> to be able to plot those sectional function graphs.
>   But already in section three I assume a memory problem caused by that
> given formular structure.
> 
>  Besides the problem on its own, I have no clue if my approach is
> approriate at all.

\documentclass{scrartcl}
\usepackage{pst-plot}

\begin{document}
\noindent
\psset{xunit=0.25,yunit=0.5}
\begin{pspicture}(-2.3,-1.6)(53,20)
\psaxes[Dx=5000,dx=5,Dy=2000,dy=2]{->}(0,0)(55,20)
\rput[t](27.5,-2){\textsf{annual income (in EUR)}}
\rput[t]{90}(-8,10){\textsf{annual income-tax (in EUR)}}
\psset{linewidth=1.5pt,linecolor=blue}
\psline[linecolor=blue](0,0)(7.834,0)
\psplot[linecolor=blue]{7.834}{13.139}{%
   /G x 1000 mul 7834 sub 10000 div def
   939.68 G mul 1400 add G mul 1000 div
}
\psplot[linecolor=blue]{13.139}{52.551}{%
   /G x 1000 mul 13139 sub 10000 div def
   228.74 G mul 2397 add G mul 1007 add 1000 div
}
\end{pspicture}

\end{document}


Herbert


More information about the PSTricks mailing list