Mercurial > hg > may
view yetilab/plot/test/test_plot.yeti @ 178:032c4986b6b0
Implement and test matrix concat
author | Chris Cannam |
---|---|
date | Thu, 02 May 2013 21:58:58 +0100 |
parents | 4065178f776b |
children |
line wrap: on
line source
module yetilab.plot.test.test_plot; ch = load yetilab.plot.chart; { compare } = load yetilab.test.test; [ "stack": \( compare (ch.stack [ "Conrad", "Alice", "Bob" ] [ "Jan", "Feb", "Mar" ] [ "Alice": [ "Jan": 3, "Mar": 2 ], "Bob": [ "Jan": 0, "Feb": 1, "Mar": 4 ], "Conrad": [ "Feb": 2, "Mar": 1 ] ] false) [ "Conrad": [ "Jan": { y0 = 0, y1 = 0 }, "Feb": { y0 = 0, y1 = 2 }, "Mar": { y0 = 0, y1 = 1 } ], "Alice": [ "Jan": { y0 = 0, y1 = 3 }, "Feb": { y0 = 2, y1 = 2 }, "Mar": { y0 = 1, y1 = 3 } ], "Bob": [ "Jan": { y0 = 3, y1 = 3 }, "Feb": { y0 = 2, y1 = 3 }, "Mar": { y0 = 3, y1 = 7 } ] ] ), "stack-normalised": \( compare (ch.stack [ "Conrad", "Alice", "Bob" ] [ "Jan", "Feb", "Mar" ] [ "Alice": [ "Jan": 3, "Mar": 2 ], "Bob": [ "Jan": 0, "Feb": 1, "Mar": 4 ], "Conrad": [ "Feb": 2, "Mar": 1 ] ] true) [ "Conrad": [ "Jan": { y0 = 0, y1 = 0 }, "Feb": { y0 = 0, y1 = 2/3 }, "Mar": { y0 = 0, y1 = 1/7 } ], "Alice": [ "Jan": { y0 = 0, y1 = 1 }, "Feb": { y0 = 2/3, y1 = 2/3 }, "Mar": { y0 = 1/7, y1 = 3/7 } ], "Bob": [ "Jan": { y0 = 1, y1 = 1 }, "Feb": { y0 = 2/3, y1 = 1 }, "Mar": { y0 = 3/7, y1 = 1 } ] ] ), ] is hash<string, () -> boolean>;