% This file is inserted into the PSPRINT User Guide using \special. % It plots 100 random dots. 72 72 scale % units now inches % uncomment the next line if you want to "psprint random.ps" % 2 2 translate /xlen 1.3 def % length of x axis /ylen 1.3 def % length of y axis newpath 0 0 moveto xlen 0 rlineto % x axis 0 0 moveto 0 ylen rlineto % y axis .01 setlinewidth stroke % draw axes /fontsize 10 72 div def % use 10pt font for labels /Helvetica findfont fontsize scalefont setfont fontsize neg dup moveto (0) show fontsize neg ylen moveto (1) show xlen fontsize 2 div add fontsize neg moveto (1) show % draw 100 random dots /randlim 2 31 exp 1 sub def % rand will return integer from 0 to 2^31 - 1 newpath 1 1 100 % do the following procedure 100 times { pop % we don't use control variable /x rand randlim div xlen mul def % x is real number from 0 to xlen /y rand randlim div ylen mul def % y is real number from 0 to ylen x y moveto x y lineto % create a dot } for 1 setlinecap % round line ends .04 setlinewidth % diameter of dots stroke % draw all dots showpage