[pstricks] Controlling arrowhead linewidth

Martin Chicoine martin.chicoine at umontreal.ca
Tue Oct 3 17:30:54 CEST 2006


Herbert Voss wrote:
>> Martin Chicoine wrote:
>> 
>>>Is there a way to control the arrowhead linewidth? I'm specifically
>>>interested in controlling the linewidth of end circles as in:
>>>
>>>        \psplot[arrows=o-o]{...}
>>>
>>>For such a curve, the end circle linewidth is the same as the curve
>>>linewidth but I would like to control it independently.
>> 
>
>> not easy, look in pstrecks.tex for \psas at o and in
>> pstricks.pro for EndDot.
>
>just had a look and saw, that it is not a big deal:
>
>\documentclass[10pt]{article}
>\usepackage{pstricks,pst-xkey}
>\makeatletter
>\define at key[psset]{}{arrowLW}{\pst at getlength{#1}\psk at arrowLW}
>\psset{arrowLW=0}
>\def\psas at o{\psk at arrowLW\space dup 0 eq { pop }{ SLW } ifelse
>   {\pst at usecolor\psfillcolor true} true \psk at dotsize \tx at EndDot }
>\makeatother
>
>\begin{document}
>
>\vspace*{3cm}
>\psset{linewidth=4pt,arrows=o-o}
>
>\psline[arrowscale=5](0,2)(5,2)%
>\psline[arrowscale=5,arrowLW=.5pt](0,0.5)(5,0.5)%
>\psline(5,0)
>
>\end{document}
>
>Herbert

I just found that this does not put the end dot at the right position as in
the following example where the dot should be at x=0.

\documentclass{article}

\usepackage{pstricks-add}

\makeatletter
\define at key[psset]{}{arrowLW}{\pst at getlength{#1}\psk at arrowLW}
\psset{arrowLW=0}
\def\psas at o{\psk at arrowLW\space dup 0 eq { pop }{ SLW } ifelse
   {\pst at usecolor\psfillcolor true} true \psk at dotsize \tx at EndDot }
\makeatother

\begin{document}
  
\psset{algebraic,arrowLW=.5pt}

\begin{psgraph}(0,0)(-2,-2)(2,2){.65\textwidth}{10cm}
			  \psplot[arrows=o-]{0}{1.5}{x^2}
\end{psgraph}

\end{document}




More information about the PSTricks mailing list