summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/milimetricpaper.mp
blob: d05d36e6491ee196b0dc4fc7eab8cf5e10552fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% milimetricpaper.mp
% L. Nobre G.
% 2005

%%input mp-tool;

beginfig(1);
  numeric u, xsize, ysize, i;
  numeric minstep, majstep, bigstep;
  pen minpen, majpen, bigpen;
  color mincolor, majcolor, bigcolor;
  u = 1mm;
  xsize = 15cm;
  ysize = 11cm;
  minstep = 2u;
  majstep = 10u;
  bigstep = 50u;
  minpen = pencircle scaled 0pt;
  majpen = pencircle scaled 0.3pt;
  bigpen = pencircle scaled 0.8pt;
  mincolor = 0.5white;
  majcolor = 0.2white;
  bigcolor = 0.5white;
  for i=0 step minstep until xsize:
    draw (i,0)--(i,ysize) withpen minpen withcolor mincolor;
  endfor;
  for i=0 step minstep until ysize:
    draw (0,i)--(xsize,i) withpen minpen withcolor mincolor;
  endfor;
  for i=0 step bigstep until xsize:
    draw (i,0)--(i,ysize) withpen bigpen withcolor bigcolor;
  endfor;
  for i=0 step bigstep until ysize:
    draw (0,i)--(xsize,i) withpen bigpen withcolor bigcolor;
  endfor;
  for i=0 step majstep until xsize:
    draw (i,0)--(i,ysize) withpen majpen withcolor majcolor;
  endfor;
  for i=0 step majstep until ysize:
    draw (0,i)--(xsize,i) withpen majpen withcolor majcolor;
  endfor;
endfig;
end.