[pstricks] 3dplot -- contour of a function

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sun Jul 25 16:06:37 CEST 2010


Am 25.07.2010 12:45, schrieb Marco Daniel:
>  Hi,
> 
> thanks for the reply. I see you are using the ngrid option. I want to
> get a surface-plot without any x or y lines.
> 
> I take the example of the pst-3dplot-doc.
> 
> Here You are using fillstyle=gradient. But it doesn't work with my example.

here a quick "on the fly" solution

\listfiles
\documentclass{article}
\usepackage{pst-3dplot,pstricks-add}

\pagestyle{empty}

\makeatletter
\def\psDichtePlot{\pst at object{psDichtePlot}}
\def\psDichtePlot at i(#1,#2,#3)(#4,#5,#6)#7{%
  \pst at killglue
  \begingroup
  \begin at SpecialObj%
  \addto at pscode{
% /p [ [ [xyz][xyz]...][xyz][xyz] ] ... [ [xyz][xyz]...][xyz][xyz] ] ] def
% to allow more than 64 kByte values
    /zMin 0 def /zMax 0 def
    /p [
    #1 #2 #3 {
      /x ED
      [
      #4 #5 #6 {
        /y ED
        [
          x y #7 dup /zVal ED
          zVal zMax gt { /zMax zVal def } if
          zVal zMin lt { /zMin zVal def } if
        ]
      } for
      ]
    } for
    ] bind def
    zMax zMin sub /zDiff ED
    0 1 p length 1 sub {
      /Index ED
      p Index get /xRowArray ED                      % get a line
      0 1 xRowArray length 1 sub {
        /rowIndex ED
        xRowArray rowIndex get aload pop             % get 3 values
        dup /zVal ED
        tx at 3DPlotDict begin Conv3D2D end
        \pst at number\psyunit mul exch
        \pst at number\psxunit mul exch
        newpath
        0.5 0 360 arc
        gsave
          zVal zMin sub zDiff div 380 mul 420 add tx at addDict begin
wavelengthToRGB Red Green Blue end setrgbcolor
          fill
          stroke
        grestore
      } for
    } for
  }%
  \end at SpecialObj%
  \endgroup%
  \ignorespaces%
}
\makeatother

\begin{document}

\psset{unit=5,Alpha=-45}
\begin{pspicture}(-1,-1)(2,2)
  \pstThreeDCoor[xMin=0,xMax=1.2,yMin=0,yMax=1.2,zMin=0,zMax=1.2]
  \psDichtePlot(0,0.005,1)(0,0.005,1){ x y mul }
\end{pspicture}

\end{document}


HErbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x.png
Type: image/png
Size: 30279 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20100725/46b0a2d7/attachment-0001.png>


More information about the PSTricks mailing list