[pstricks] \uput in conflict with vector field code

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri Jun 4 16:16:17 CEST 2010


Am 04.06.2010 15:49, schrieb Hernando Diaz Morales:

> The following code compiles just fine, 0 errors or warnings. However, GSView 
> crashes when trying to display it.
> If I comment out the \uput[45](IT){$W^s$} statement, it works perfectly and it 
> can be seen on GSView without any problems.
> Replacing \uput by \rput also produces a crashing-producing result..

do not use /x and /y in global definitions of PS code, they
are already defined by another PS code. use rx, ry or something
similiar.
And, by the way. define global variables before \multido:
\documentclass{minimal} % Hernando Diaz
% 2- Allele Population dynamics with sexual reproduction
%
\usepackage{pstricks,pstricks-add}
\begin{document}
\pstVerb{
  /eta 1.05 def
  /theta 0.95 def
}
%\def\MaxMag{4.2}
% Vector field computation
% Based on a file at the PSTricks web site
\def\MaxMag{1.1}
\psset{unit=8cm,linewidth=0.5pt,linecolor=blue}
\SpecialCoor
\psset{arrows=->}
\begin{pspicture*}(-0.05,-0.05)(1.05,1.05)
\multido{\rx=0.00+0.05}{21}{%
\multido{\ry=0.00+0.05}{21}{%
  \pstVerb{
     /rx \rx\space def
     /ry \ry\space def
     /opu 1 rx add ry sub def
     /omu 1 rx sub ry add def
     /Fx opu dup mul 1 rx sub mul omu
         dup mul rx mul theta mul sub omu opu mul rx mul
         eta mul 2 mul sub def
     /Fy omu dup mul 1 ry sub mul theta mul
         opu dup mul ry mul sub omu opu mul ry mul
         eta mul 2 mul sub def
     /mag Fx dup mul Fy dup mul add sqrt def
     /MagF mag \MaxMag\space div 0.05 mul def
     mag 0 eq { /ValueTempx 0 def /ValueTempy 0 def}
              {/ValueTempx Fx mag div MagF mul 2 div def
               /ValueTempy Fy mag div MagF mul 2 div def} ifelse }
    \psline[linecolor=gray,arrowscale=0.8,linewidth=0.25pt](!
       rx ValueTempx sub ry ValueTempy sub)(!
       rx ValueTempx add ry ValueTempy add)}}
\psIntersectionPoint(0.452,0.119)(0.952,0.619)(0,1)(1,0){IT}
\uput[45](IT){$W^s$}
\qdisk(IT){3pt}
\end{pspicture*}

\end{document}


Herbert


More information about the PSTricks mailing list