File: 3-3-17.mp

package info (click to toggle)
texlive-lang 2014.20141024-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,003,116 kB
  • ctags: 12,320
  • sloc: perl: 42,934; xml: 18,105; makefile: 4,433; ansic: 2,845; sh: 2,631; python: 1,398; ruby: 674; awk: 636; lisp: 603; java: 159; sed: 142
file content (33 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (11)
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
input graph
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
numeric r,last; path c,w;
r:=5; c:=fullcircle scaled 2r;
last:=0.0;
def wedge (expr lang,value,perc) =
 numeric current,n,half,xoff,yoff;
 picture p;
 n:=perc*3.6;
 current:=last+n;    half:=last+(n/2);
 w:=buildcycle((0,0)--(2r,0) rotated last,
  c, (2r,0)--(0,0) rotated current);
 gfill w withcolor (0,0.8-(perc/100),0);
 gdraw w;
 if perc > 5:
 p = lang infont defaultfont
    scaled defaultscale;
 glabel(image(unfill bbox p; draw p),
  3/4r*dir(half));
 fi;
 last:=current;
enddef;
draw begingraph(3in,3in);
defaultscale:=0.7;
gdata ("langs.dat",c,
  wedge(c1, (scantokens c2),
   (scantokens c3)););
autogrid(,);  frame withcolor white;
endgraph;
endfig;
end;