view yetilab/plot/test/test_plot.yeti @ 133:40089797b032

Axis labels (percents and dates)
author Chris Cannam
date Mon, 22 Apr 2013 21:46:37 +0100
parents 759edd0d02ce
children 4065178f776b
line wrap: on
line source
module yetilab.plot.test.test_plot;

p = load yetilab.plot.plot;

{ compare } = load yetilab.test.test;

[

"stack": \(
    compare
       (p.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
       (p.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>;