# [pstricks] Define zmaxvalue/zminvalue of a function

Sat May 12 14:33:54 CEST 2012

Hi,

I am trying to use pst-solides3d to plot a function of the form z=f(x,y).

However I don't know how to specify the maximum value of z. The bonus
would be to jump over division by zero.

The following example uses pgfplots and does the job. But I want to use
pstricks ;-)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}

\usepackage{xcolor}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}

\begin{axis}[

view={30}{6},

% view={20}{5},

restrict z to domain*=-1:8,

xlabel=$x$,ylabel=$y$,

zmin=-1,zmax=9,xmin=-2.25]

set xrange [-2:2];

set yrange [-2:2];

set pm3d;

splot exp(x/(x**2+y**2));

};

\end{axis}

\end{tikzpicture}
\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I tried:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{pspicture}(-1,-1)(6,8)

\psset{lightsrc=viewpoint,viewpoint=50 60 30 rtp2xyz,Decran=40,}

\psSurface[ngrid=.25 .25,incolor=yellow,

,axesboxed,

Zmax=10,Zmin=0,hue=0 1, h=6](-3,-3)(3,2){%

2.729 x y dup mul x dup mul add div exp}

\end{pspicture}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Viele Grüße
Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20120512/868384dd/attachment.html>