BoxPlot := proc(L::list) local N, i, A, D, m, M, Minn, Maxx, P25, P50, P75, eh; option `June 4, 1999 -- Elliot Tanis (Zaven A. Karian)`; description `Box-and-whisker display`; N := nargs; Minn := Min(args[1]); Maxx := Max(args[1]); for i to N do if not type(args[i],list) then ERROR(`All arguments must be lists`) fi od; A := {}; for i from 1 to N do D := args[i]; m := Min(D); M := Max(D); if m < Minn then Minn := m fi; if Maxx < M then Maxx := M fi; P25 := Percentile(D,.25); P50 := Percentile(D,.50); P75 := Percentile(D,.75); A := A union {[[P25, i-.2], [P75, i-.2]], [[P25, i-.6], [P25, i-.2]], [[P50, i-.6], [P50, i-.2]], [[P75, i-.6], [P75, i-.2]], [[m, i-.4], [P25, i-.4]], [[P75, i-.4], [M, i-.4]], [[P25, i-.6], [P75, i-.6]]} od; eh := 1/20*Maxx-1/20*Minn; plot(A,Minn-eh .. Maxx+eh,0 .. N+.2,tickmarks=[5,0],color = blue) end;