[pstricks] smoothing 3d plot (pst-3dplot with fileplotThreeD)

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Nov 14 16:16:44 CET 2011


Am 14.11.2011 14:47, schrieb Toche, Patrick:

> My first problem is that I don't understand how to set the units (and why there isn't a zunit!).
>
> Expressed in the actual units of the data, the range of interest for my plot is:
>
>        xMin = -0.010
>      , xMax = +0.000
>      , yMin = +0.026
>      , yMax = +0.030
>      , zMin = +0.026
>      , zMax = +0.030
>
> (The numbers I selected below are just so I can see the trajectories and the axes, but it doesn't correspond to the final product, as I couldn't figure out the proper way to select units)
>
> I want the pspicture to more or less fill an A4, or half of an A4 or even better an A4 in landscape mode rather than portrait. Or, rather, I want to maximize quality (file size is not a problem), however that may be achieved.
>
> I just don't understand how to select the xunit and yunit.

that two are only valid for the 2d coordinate system.
For the 3d use \pst at ScalePoints as seen in this example
which also shows how the data records can be tested

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

\def\zMaxVal{ 0.030 }
\def\xMinVal{-0.05\space}
\iffalse
       xMin = -0.010
     , xMax = +0.000
     , yMin = +0.026
     , yMax = +0.030
     , zMin = +0.026
     , zMax = +0.030
\fi
\makeatletter%
\pst at def{ScalePointsThreeD}<%
    counttomark dup dup cvi eq not { exch pop } if
    /m exch def /n m 3 div cvi def
    n {  % checkdata
      3 -1 roll % y z x
      dup \xMinVal lt { pop pop pop /m m 3 sub def }{ 3 1 roll m 3 roll 
} ifelse
    } repeat % checkdata
    /n m 3 div cvi def
       n {
      tx at 3DPlotDict begin
      10 mul   %%%% all * 10
      3 1 roll 10 mul
      3 1 roll 10 mul
      3 1 roll
      saveCoor
      ConvertTo2D
      x2D \pst at number\psxunit mul y2D \pst at number\psyunit mul
      end
      m 1 sub 1 roll m 1 sub 1 roll /m m 3 sub def
     } repeat
 >
\makeatother%

\pagestyle{empty}%

\begin{document}%

   \def\xMin{-1}%
   \def\xMax{0}%
   \def\yMin{0}%
   \def\yMax{1}%
   \def\zMin{0}%
   \def\zMax{1}%

\def\N{5}%Number of Lines
\definecolorseries{lineColors}{hsb}{last}{red}{blue}%
\resetcolorseries[\N]{lineColors}%
\begin{pspicture}(-2,-2)(5,5)%
\psset{unit=5}
     \pstThreeDCoor[%
       xMin = \xMin
     , xMax = \xMax
     , yMin = \yMin
     , yMax = \yMax
     , zMin = \zMin
     , zMax = \zMax
     , IIIDticks = true
     , IIIDlabels = true
     , IIIDticksize = 0.2
     , linecolor = red
     , linewidth = 2\pslinewidth
     , nameX = $\mathbf{x}$
     , nameY = $\mathbf{y}$
     , nameZ = $\mathbf{z}$
   ]%
\multido{\nA=1+1}{\N}{%
   \readdata{\data}{/tmp/mist5/xyz\nA.txt}%
   \listplotThreeD[
     plotstyle = line
     , linecolor = {lineColors!![\nA}% syntax is [\n ??
     ]{\data}%
}%
\end{pspicture}

\end{document}

and by the way: attach data files as separate files and not in the included

Herbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto.png
Type: image/png
Size: 3690 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20111114/b15d149b/attachment-0001.png>


More information about the PSTricks mailing list