geometric transformations

Thomas Siegel siegel at aix550.informatik.uni-leipzig.de
Wed Apr 22 14:16:42 CEST 1998


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

Rick Hensh wrote:
> Perhaps someone can help. It is easy to use PSTricks and specials to graph
> the function,
> say
> 
>         y = f[x]
> 
> For example, if f[x] = x*(1-x) I've successfully tried
> 
> \special{!/myfunction {x dup 1 exch sub mul} bind def}
> \psplot[myparem]{-5}{5}{myfunction}
> 
> Now I would like to sketch    y = f[x-2]     by trying something like
> 
> \psplot[myparem]{-5}{5}{x 2 sub myfunction}
> 

you should define your function in a different way. Here is a little
example:

\documentclass{article}

\usepackage{pstricks}
\usepackage{pst-plot}



\begin{document}

\psset{yunit=.5cm}

\special{!/myfunction {dup 1 exch sub mul} bind def}

\begin{pspicture}(-5,-30)(5,1)\psgrid
\psplot[linecolor=red]{-5}{5}{x myfunction}
\psplot[linecolor=green]{-3}{5}{x 2 sub myfunction}
\end{pspicture}

\end{document}

-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list