input graph; prologues := 3; outputformat := "svg"; outputtemplate := "VIZ-07-004.svg"; color Blue, Teal, Orange, Wash, Missing; Blue := (0, 84 / 255, 159 / 255); Teal := (0, 177 / 255, 183 / 255); Orange := (246 / 255, 168 / 255, 0); Wash := (232 / 255, 241 / 255, 250 / 255); Missing := (236 / 255, 236 / 255, 237 / 255); vardef P(expr x, y) = (55 + 345 * (x - (0)) / (75), 45 + 175 * (y - (0)) / (1)) enddef; def rect(expr x, y, xx, yy, col) = fill P(x, y)--P(xx, y)--P(xx, yy)--P(x, yy)--cycle withcolor col; enddef; beginfig(1); fill unitsquare xscaled 420 yscaled 280 withcolor white; label.llft("VIZ-07-004" infont "cmr8", (414, 272)); label.rt(btex Known ages: n=2,205; 2 ages missing etex scaled .65, (55, 246)); draw P(0, 1)--P(0, 0)--P(75, 0) withcolor .4white; label.bot(btex 0 etex scaled .7, P(0, 0)); label.bot(btex 15 etex scaled .7, P(15, 0)); label.bot(btex 30 etex scaled .7, P(30, 0)); label.bot(btex 45 etex scaled .7, P(45, 0)); label.bot(btex 60 etex scaled .7, P(60, 0)); label.bot(btex 75 etex scaled .7, P(75, 0)); label.lft(btex 0 etex scaled .7, P(0, 0)); label.lft(btex 0.25 etex scaled .7, P(0, 0.25)); label.lft(btex 0.5 etex scaled .7, P(0, 0.5)); label.lft(btex 0.75 etex scaled .7, P(0, 0.75)); label.lft(btex 1 etex scaled .7, P(0, 1)); label(btex Age (years) etex scaled .8, (227.5, 13)); label(btex Cumulative fraction etex scaled .8 rotated 90, (13, 132)); % BEGIN EXAMPLE numeric n, v[][]; n := 0; gdata("data/ecdf.tsv", c, n := n + 1; for j = 1 upto 2: v[n][j] := scantokens c[j]; endfor ); path curve; curve := P(v[1][1], v[1][2]); for k = 2 upto n: curve := curve--P(v[k][1], v[k][2]); endfor draw curve withpen pencircle scaled 1 withcolor Blue; % END EXAMPLE setbounds currentpicture to unitsquare xscaled 420 yscaled 280; endfig; end.