if unknown mode: mode:= localfont; fi if unknown mag: mag:=1200/1000; fi if unknown grafbase: input grafbase; fi gcode:=0; headshape (1, 1, true); mftitle "Commutative Diagram example."; unitlen:=1.0pt#; xscale:=12; yscale:=12; xneg:=0; xpos:=10; yneg:=0; ypos:=10; beginmfpic (incr gcode); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((1,8.5), (1,1.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((1.5,8.5), (2.5,5.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((2.5,4.5), (1.5,1.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((1.5,9), (8.5,9)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((9,8.5), (9,1.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((8.5,8.5), (7.5,5.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((7.5,4.5), (8.5,1.5)); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn polyline (false) ((3.5,5), (6.5,5)); store (curpath) dotted (0.5pt,3.0pt) headpath (3.0pt, 90, -12pt) headpath (3.0pt, 0 deg, 15pt) reverse headpath (3.0pt, 0 deg, 0pt) polyline (false) ((1.5,1), (8.5,1)); endmfpic; mftitle "Function Plot with Cartesian Axes."; unitlen:=1.0pt#; xscale:=20; yscale:=20; xneg:=-3; xpos:=3; yneg:=-3; ypos:=3; beginmfpic (incr gcode); axes (5.0pt); store (curpath) drawn function ( true) (-2,2,0.1) (((x**3)-x)/3); endmfpic; mftitle "Parametric Function Plot, and Filled Circle."; unitlen:=1.0pt#; xscale:=30; yscale:=30; xneg:=-1; xpos:=1; yneg:=-1; ypos:=1; beginmfpic (incr gcode); store (curpath) drawn plrfcn ( true) (0,540,5) (cosd(5/3t)); store (curpath) filled circle ((0,0),0.25); endmfpic; mftitle "Bar Graph."; unitlen:=1.0pt#; xscale:=20; yscale:=20; xneg:=-0.5; xpos:=4; yneg:=-0.5; ypos:=4; beginmfpic (incr gcode); axes (5.0pt); store (curpath) shade (1.0pt) drawn rect ((0,0),(1,0.5)); store (curpath) shade (0.83333pt) drawn rect ((1,0),(2,1)); store (curpath) thatch (3.0pt, 45 deg) thatch (3.0pt, -45 deg) drawn rect ((2,0),(3,2)); endmfpic; mftitle "Pie Chart."; unitlen:=1.0pt#; xscale:=30; yscale:=30; xneg:=-1; xpos:=1.4; yneg:=-1; ypos:=1.1; beginmfpic (incr gcode); store (curpath) filled sector ((0.3,0.2), 1, 0,60); store (curpath) shade (0.83333pt) sector ((0,0), 1, 60,105); store (curpath) drawn turtle ((0,0), map (polar) ((1,105))); store (curpath) drawn sector ((0,0), 1, 60,360); endmfpic; mftitle "Circle with Arrow."; unitlen:=1.0pt#; xscale:=20; yscale:=20; xneg:=-1; xpos:=1; yneg:=-1; ypos:=1; beginmfpic (incr gcode); store (curpath) headpath (3.0pt, 0 deg, 0pt) drawn circle ((0,0),1); endmfpic; mftitle "Use of hatch, draw, lclosed, connect, curve, point, lines, dotted, reverse."; unitlen:=1.0pt#; xscale:=20; yscale:=20; xneg:=-2; xpos:=2; yneg:=-2; ypos:=2; beginmfpic (incr gcode); store (curpath) thatch (3.0pt, 45 deg) thatch (3.0pt, -45 deg) drawn lclosed begingroup; hide (numeric nexus; path nexus[]; nexus = 0;) store (nexus[incr nexus]) drawn curve (false) ((1,0), (1,0.5), (1,1), (0,1.5)); pointd (2.0pt, true) ((0,0)); mkpoly (false, nexus) endgroup store (curpath) drawn polyline (false) ((-1,1), (-1,-1), (1,-1.5)); pointd (2.0pt, true) ((0,0)); store (curpath) dotted (0.5pt,3.0pt) reverse polyline (false) ((-2,2), (-2,-2), (2,-3)); endmfpic; mftitle "Simpler variant of the previous figure."; unitlen:=1.0pt#; xscale:=40; yscale:=40; xneg:=-1; xpos:=1; yneg:=-1; ypos:=1; beginmfpic (incr gcode); store (curpath) thatch (3.0pt, 45 deg) thatch (3.0pt, -45 deg) drawn lclosed begingroup; hide (numeric nexus; path nexus[]; nexus = 0;) store (nexus[incr nexus]) drawn curve (false) ((1,0), (0.5,0.25), (0.5,0.5), (0,0.75)); pointd (2.0pt, true) ((0,0)); mkpoly (false, nexus) endgroup store (curpath) reverse drawn polyline (false) ((-0.5,0.5), (-0.5,-0.5), (0.5,-0.75)); endmfpic; end.