[pstricks] pstricks about psdot
Herbert Voss
Herbert.Voss at FU-Berlin.DE
Sun Jan 20 20:50:21 CET 2013
Am 19.01.2013 13:36, schrieb Germain BOYER:
> For me it's difficult to control dotsize and dotscale, so i write two
> macros \psdotx and \psdotl
I do not really understand what do you want to draw.
However, here is an example how optional arguments
can be used:
\documentclass[a4paper,11pt]{article}
\usepackage[dvipsnames]{pstricks}
\usepackage{pst-eucl}
\makeatletter
\def\psdotx{\@ifnextchar[{\psdotx at i}{\psdotx at i[nodesep=1.5mm]}}
\def\psdotx at i[#1](#2)#3{{%
\psset{#1}%
\pnode(#2){thenode}%
\multido{\r=#3+90 , \ia=1+1}{4}{%
\pnode([angle=\r]#2){thenode\ia}
\psline(#2)(thenode\ia)%
}% fin du \multido
}}% fin de \newcommand
\makeatother
\begin{document}
\psset{unit=0.5cm}
%
\begin{pspicture}(-2,-1)(8,6.2)
%
\psset{gridcolor=gray, gridwidth=0.15mm, gridlabels=0pt, subgriddiv=1}
%\psgrid(-2,-1)(8,6)
\pnode(4,1){A}
\pnode(6,2){B}
\pnode(1,5){C}
\pnode(3,4){D}
\pnode(2,1){E}
\psset{linewidth=0.35mm}
\psdotx[nodesep=1.25mm](A){90}
\psdotx[nodesep=2mm](B){45}
\psdotx[nodesep=2mm](C){60}
\psdotx[nodesep=2mm,linecolor=red](D){90}
\psdotx[nodesep=2mm,linewidth=2mm](E){30}
\end{pspicture}
%
\end{document}
Herbert
More information about the PSTricks
mailing list