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

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Nov 14 08:59:59 CET 2011


Am 13.11.2011 22:00, schrieb Toche, Patrick:

>>> 2. Is there an efficient way to load several trajectories
>> please provide such a _short_ set of data records, e.g. 5 records
>
> I have copied the data below. They are saved in 5 text files named
> xyz1.txt
> xyz2.txt
> xyz3.txt
> xyz4.txt
> xyz5.txt
>
> Below I tried to combine multido with \fileplotThreeD, but only managed to plot the data from xyz1.txt. The loop doesn't work.
>
> I'd also want to plot each line in a different color. Any hints would be appreciated.

Here is an example how the data can be modified:

\documentclass{article}

\usepackage{pst-3dplot}
\makeatletter
\pst at def{ScalePointsThreeD}<%
   counttomark dup dup cvi eq not { exch pop } if
   /m exch def /n m 3 div cvi def
   n { 				% now we have x y z
     tx at 3DPlotDict begin
     100 mul %%%% 10*z
     3 -1 roll %%%% y 100*z x
     20 mul
     3 1 roll %%%% 20*x y 100*z
     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
\begin{document}
\readdata{\data}{/tmp/mist5/xyz1.txt}
\begin{pspicture}(-6,-3)(6,10)
  \pstThreeDCoor[xMin=-10,xMax=10,yMin=-10,yMax=10,zMin=-2,zMax=10]
  \listplotThreeD[plotstyle=line,linecolor=blue]{\data}
%\readdata{\data}{/tmp/mist5/xyz2.txt}
%\listplotThreeD[plotstyle=line,linecolor=red]{\data}
% ...
  \end{pspicture}
\end{document}

\readdata also has some keywords for reading a specific range

Herbert


More information about the PSTricks mailing list