Source PostScript (ticks.pps)

Retour Texte non formaté
%% demi-longueur d'un tiret (en point postscript) /ticklength 2.5 def %% trace d'un tiret sur Ox %% syntaxe~: x longueur xt@ck /xt@ck { 1 dict begin gsave newpath /valeur exch def Oy smoveto 0 valeur rmoveto 0 valeur 2 mul neg rlineto stroke grestore end } def /xtick {ticklength xt@ck} def /xtkstep 1 def /setxtkstep { /xtkstep exch def } def %%% les ticks sur l'axe Ox /xticks { 2 dict begin /n xmax xtkstep div truncate cvi xtkstep mul def % tick max /i xmin xtkstep div truncate cvi xtkstep mul def % la 1ere { i 0 ne {i xtick} if /i i xtkstep add store i n gt {exit} if } loop end } def /ytkstep 1 def /setytkstep { /ytkstep exch def } def %%% les ticks sur l'axe Oy /yt@ck { 1 dict begin gsave newpath /valeur exch def Ox exch smoveto valeur 0 rmoveto valeur 2 mul neg 0 rlineto stroke grestore end } def /ytick {ticklength yt@ck} def /yticks { 2 dict begin /n ymax ytkstep div truncate cvi ytkstep mul def % tick max /i ymin ytkstep div truncate cvi ytkstep mul def % la 1ere { i 0 ne {i ytick} if /i i ytkstep add store i n gt {exit} if } loop end } def /settkstep { setytkstep setxtkstep } def /ticks { xticks yticks } def