[pstricks] Logarithmic range in PST-3d

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Nov 13 18:49:07 CET 2011


Am 13.11.2011 10:30, schrieb Felix Hoffmann:

> The strategy of "\pstVerb{ /Ln { dup abs 1.e-30 lt { pop 1e-30 } if ln }
> def } " did not work with me, I got an error anyway, but adding the
> minimal value 1.e-32 to the argument of the logarithm fixed the error
> message and I got a picture! But I am not perfectly happy as my function
> gets some kind of cut off at the value 32 (due to the fact that
> -1.0*ln(e^(-32))=32). I very much would like to draw my function
> further. Is there any way to make the "ln" function to accept values
> that are closer to zero? Some kind of extending some buffer or
> redefining the approximation of the "ln" function in the pstricks code
> or something like that?

this works for me with current TeXLive:

\documentclass{report}

\usepackage{pst-3dplot}

\begin{document}
\begin{pspicture}(-6.5,-6.5)(6.5,6.5)\psset{Alpha=30,Beta=15}
\pstVerb{ /Ln { dup abs 1.e-32 lt { pop -72 } { ln } ifelse } def }
\psplotThreeD[plotstyle=curve, drawStyle=xyLines,hiddenLine=false,
yPlotpoints=100,xPlotpoints=100,linewidth=0.5pt,algebraic=true,zThreeDunit=0.1](-7,7)(-7,7)
    {-1.0*Ln(0.31831*(2.718^(-0.5*(4*(x-3)^2+4*(y-3)^2)))%
             +0.31831*(2.718^(-0.5*(4*(x+3)^2+4*(y+3)^2))))}
\pstThreeDCoor[xMin=-1,xMax=7,yMin=-1,yMax=7,zMin=-1,zMax=100,zThreeDunit=0.1]
\end{pspicture}
\end{document}


Herbert


More information about the PSTricks mailing list