summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-2-26.mp
blob: 4f8eca479fad7c8cd40885153df8ced856b98f31 (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
% --- start of displayed preamble in the book ---
input piechartmp
% --- end of displayed preamble in the book ---
% graphic converted to gray in book using 'color2gray'
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
SetupColors((.7,.7),this,this);
SetupPercent(this, " %");
Segment(50,"Lions");  Segment(30,"Tigers");
Segment(10,"Hyaena"); Segment(20,"Monkeys");
Segment(20,"Warthogs");
SegmentState(4,this,0.3);
SegmentState(5,invisible,this);
PieChart(2cm,0.15,60,0,0);
Label.auto(0)(name)(outwards,0);
Label(3,4,5)(value)(inwards,0) withcolor white;
Label(1,2)(percent)(inwards,0) withcolor (1,1,0);
Label.lrt(3)("a segment with ",percent)
            ((0.9,0.8),(0,-2cm)) withcolor .8red;
pickup pencircle scaled 2pt;
Label.auto(2)("a green label")
        ((0.9,0.1),(-1cm,7mm)) withcolor .8green;
endfig;
end;