[pstricks] Arrow Position

Herbert Voss Herbert.Voss at FU-Berlin.DE
Sat Mar 22 17:48:13 CET 2008


Vincent McGarry schrieb:
> Is there anyway to shift the arrow position so that the thickness of the 
> line doesn't mask the point of the arrow? Making the arrow larger works 
> but then the arrow is too large for the diagram.

the last segment of a line is taken into account for the arrow.
When having a lot of plotpoints the dx of the last segment is smaller
than the arrow width. This is the reason why you'll see the line
when its width is greater than the arrow width at this point.
A fix is to draw the line in two intervals:

\documentclass{article}
\usepackage{pstricks-add}
\begin{document}

\psset{unit=0.8}
\begin{pspicture}(-8,-8)(8,8)
   \psgrid[gridlabels=0pt,gridcolor=black!15,subgriddiv=0](-7,-7)(7,7)
   \psaxes[Dx=5,Dy=5]{->}(0,0)(-8,-8)(8,8)[$x$,0][$y$,90]
   \psplot[linewidth=2pt,arrows=*-,
	plotpoints=500,algebraic]{-2}{3}{sqrt(x+2)-1}
   \psplot[linewidth=2pt,arrows=->,     % plotpoints=20 is the default
	algebraic]{3}{8}{sqrt(x+2)-1}
   \rput*(4,2){$f$}
\end{pspicture}

\end{document}


Herbert



More information about the PSTricks mailing list