[pstricks] pstScalePoints for z-unit 3dPlots

Herbert Voss LaTeX at zedat.fu-berlin.de
Mon Aug 13 17:34:14 CEST 2007


Am Mittwoch, 8. August 2007 21:01 schrieb Martin Hehn:
> hello everybody,
>
> I'm searching for a way to scale my z-unit of a 3dplot.
> The \pstScalePoints command is only valid for x and y.
> I would need something like \pstScalePoints(0.5,1,1){}{}{62 sub}
> to let the first value be 62 and not 0.

there is a PS-subroutine ScalePointsThreeD, you can modify it easily,
see above for x and z-values

Herbert


\documentclass{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\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
    3 -1 roll           % y z x
    100 div	%<==============================!!!!
    \psk at ThreeDplot@xThreeDunit\space div
    dup                 % y z x x
    neg Alpha cos mul   % y z x (x)
    4 -1 roll           % z x (x) y
    \psk at ThreeDplot@yThreeDunit\space div
    dup                 % z x (x) y y
    5 1 roll            % y z x (x) y
    Alpha sin mul add \pst at number\psxunit mul   % y z x (x2)
    4 1 roll            % (x2) y z x
    Alpha sin mul               % (x2) y z (x)
    3 -1 roll           % (x2) z (x) y
    Alpha cos mul add neg Beta sin mul % (x2) z (x)
    exch                        % (x2) (x) z
    62 sub 	%<==============================!!!!
    \psk at ThreeDplot@zThreeDunit\space div 
    Beta cos mul add \pst at number\psyunit mul    % (x2) (y2)
    m 1 sub 1 roll m 1 sub 1 roll /m m 3 sub def } repeat>

\makeatother

\begin{document}
\pagestyle{empty}

\readdata{\data}{3dplot.txt}
\psscalebox{0.8}{%
  \psset{Alpha=45,Beta=30}
  \pstThreeDCoor[xMin=0,yMin=0,zMin=0,xMax=4,yMax=8,zMax=3]%
  \listplotThreeD[plotstyle=line,drawStyle=xyLines]{\data}
}
\end{document}



More information about the PSTricks mailing list