[pstricks] psclip

Michael Sharpe msharpe at ucsd.edu
Tue Nov 11 00:48:25 CET 2008


I can't tell you why, but you can get around the problem if you  
replace the \psframe, which \psclip does not seem to like, with  
\psline[linecolor=red](-25,0)(40,0)(40,25)(-25,25)(-25,0), which works  
properly.

One other bothersome problem about \psframe is that something goes  
wrong in an even worse way in your example if you use \begin{psclip}... 
\end{psclip} in place of the supposedly equivalent \psclip ... 
\endpsclip.

By the way, there's an errant 3 in your \getColor definition.

Michael


On Nov 10, 2008, at 2:10 PM, Poul Riis wrote:

> What is wrong with psclip in the example below?
>
> Poul Riis
>
>
>
> \documentclass[a4paper,12pt]{article}
> \usepackage{inputenc}
> \usepackage[T1]{fontenc}
> \usepackage[danish]{babel}
> \usepackage[usenames,dvipsnames,x11names]{xcolor}
> \usepackage{ifthen}
> \usepackage{geometry}
> \usepackage{multido}
> \usepackage{pst-func}
> \usepackage{pstricks-add}
>
>
> \def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green 
> \or
> Orange\or blue\or
> 3 DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
>
>
> \begin{document}
> \begin{center}
> \psset{unit=2mm}
> \begin{pspicture}(-25,-5)(40,25)
> \psaxes[Dx=5,Dy=5,ticksize=-3pt]{->}(0,0)(-25,0)(40,25)
> \multido{\nn=0+1}{10}{%
> \pstVerb{/gg 9.82 def /v0 20 def /c0w 0.2 def /costhetac c0w v0 mul  
> gg div
> 2 div neg def /sinthetac costhetac dup mul neg 1 add sqrt def /thetac
> sinthetac costhetac atan def /theta thetac \nn\space 2 sub 5 mul sub  
> def
> /x1 theta sin v0 mul def /x2 gg c0w div def /x3 theta cos v0 mul x2  
> add
> def /pi 3.141592 def}%
> \psclip{\psframe[linecolor=red](-25,0)(40,25)}%
> \parametricplot[linecolor=\getColor{\nn}]{0}{45}{t cos neg 1 add x1  
> mul t
> sin x3 mul add c0w div  t 180 div pi mul c0w div x2 mul sub t cos  
> neg 1
> add x3 mul neg t sin x1 mul add c0w div}%
> \endpsclip
> }
> \uput{2mm}[0](10,20){$\theta_c=$ 
> \psPrintValue[valuewidth=8,fontscale=8]{thetac}}
> \end{pspicture}
> \end{center}
> \end{document}
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>



More information about the PSTricks mailing list