[pstricks] Using ps code in psplot's limits

Juergen Gilg gilg at acrotex.net
Sat Mar 8 01:42:15 CET 2008


Dear Hubert,

this could be of interest for your subjects ...

\documentclass{article}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-1.5,-0.5)(4.5,7.5)
\pstVerb{%
/funcf {0.5 mul neg Euler exch exp 6 mul}  def
/funcg {0.5 mul Euler exch exp 0.5 mul}  def
/x1 0 def
/x2 1 def
/x3 2 def
/x4 3 def
/x5 4 def
}
\psaxes{->}(0,0)(-0.5,-1.5)(5.5,7.5)
\psplot[linecolor=blue]{0}{5}{x funcf}
\psplot[linecolor=red]{0}{5}{x funcg}
\psdot(!x1 dup funcf)
\psdot(!x2 dup funcf)
\psdot(!x3 dup funcf)
\psdot(!x4 dup funcf)
\psdot(!x5 dup funcf)
\psdot(!x1 dup funcg)
\psdot(!x2 dup funcg)
\psdot(!x3 dup funcg)
\psdot(!x4 dup funcg)
\psdot(!x5 dup funcg)
\end{pspicture}
\end{document}


Regards,

Juergen

Hubert Lam wrote:
> Alan Ristow wrote:
>   
>> Hubert Lam wrote:
>>     
>>> Given that the usage of \psplot (excluding options) is
>>>
>>> \psplot{x_min}{x_max}{PS code for function}
>>>
>>>
>>> is there a mechanism that I'm not aware of that will allow the effects 
>>> of this:
>>>
>>> \usepackage{pstricks,pst-math}
>>> \def\PiFour{PI 4 div}
>>> \psplot{0}{\PiFour}{x SIN}
>>>       
>> Yes. I suppose there's more than one way to do it, but the way I would 
>> do this is (untested):
>>     
>
> Thank you gentlemen -- Jurgen's way is correct. That will make life MUCH 
> easier now! :)
>
> Perhaps for the next example of the pstricks user manual might have more 
>   examples on using PostScript code? I'm happy to contribute especially 
> with things like
>
> \def\Func{x COS}
> \psdot(!4 PI mul 7 div /x 4 PI mul 7 div def \Func)
>
> where the dot is created at (4pi/7, cos(4pi/7)). This I learnt from 
> looking at one of Herbert Voss' examples on tug.org/pstricks and would 
> be helpful to teachers/academics who are drawing curves.
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
>
>   

-- 
 Jürgen Gilg
 Austr. 59
 70376 Stuttgart
-------------------------------------
 Tel       0711.59 27 88
 e-Mail    gilg at acrotex.net
 Websites  www.acrotex.net
           www.brueckenkurs-physik.de
           www.gilligan-online.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20080308/643347ec/attachment.html 


More information about the PSTricks mailing list