[pstricks] Using the "psplot"

Chris Sangwin sangwinc at for.mat.bham.ac.uk
Fri Nov 16 11:12:48 CET 2001

Dear Stephane,

I often use PSTricks to calculate mathematical functions, etc and then
plot them.

The LaTeX package `fp' is useful for performing calculations, and the
following example - very helpfuly supplied by DG a few months ago in reply
to a similar queary of my own - uses psplot.  The image produced is a
quadratic equation (line 36) projected using single point
perspective.  This *is* an ellipse - but using psellipse would have been
cheating wouldn't it!

The moral is - there is no need to write more than one piece of
code.  LaTeX is capable of calculating without recourse to external
packages, such as Mathematica.


------ LaTeX Code follows --------------

\usepackage{pst-plot}     % From PSTricks






\FPeval{\iY}{\Ypsz * \iy / (\iy + 1.0)}  % Calculates Y-coordinate
\FPeval{\iX}{(\Ypsz - \iY)* \ix / \Xpsz} % Calculates X-coordinate
}% End perspective calculate


  % The horizontal perspective grid
    \FPneg{\iXX}{\iX}                    % Exploits symmetry 
    \psline(\iXX,\iY)(\iX,\iY)}          % End of the horizontal grid


    \FPeval{\Ry}{ (\IRx * \IRx) / 30.0 }   % Defines the quadratic


%  \dataplot[plotstyle=curve,showpoints=true]{\MyCurve}



More information about the PSTricks mailing list