[pstricks] Newbie question on how to create an own object

Seweryn Kokot skokot at po.opole.pl
Sat Dec 2 22:30:55 CET 2006

> >
> > How to start with it?
> it is called a high level object and the different packages
> create a lot of it, eg \psGaus from package pst-func;
> \define at key[psset]{pst-func}{sigma}{\def\psk at sigma{#1 }}
> \define at key[psset]{pst-func}{mue}{\def\psk at mue{#1 }}
> \psset[pst-func]{sigma=0.5,mue=0}
> %
> \def\psGauss{\@ifnextchar[{\psGauss at i}{\psGauss at i[]}}
> \def\psGauss at i[#1]#2#3{{%
>      \pst at killglue%
>      \psset{plotpoints=200}%
>      \psset{#1}%
>      \psplot{#2}{#3}{%
>          Euler x \psk at mue sub dup mul 2 div \psk at sigma dup mul div neg exp
>          1.0 \psk at sigma div TwoPi sqrt div mul%
>      }%
> }\ignorespaces}

Well the syntax is not newbie friendly. I can figure out how the above example
works but what if I specify (x,y) and the other object must be calulated based
on these (x,y) coordinates?
For example:
How to draw the horizontal line with ends at (x-2,y-2) and (x+2,y-2) based on
specified (x,y)? And how to specify a rotation and the mirror image with
regards the axis x in options?

Seweryn Kokot

More information about the PSTricks mailing list