Anonymous avatar Anonymous committed 1b8232f

Make creating plots work again.
This involved two changes:
1) Use vector rather than uvector
2) Update to use Chart-0.13; the only change is usage of
BarsFixGap, where the second parameter is the minimum width of
the bars created (not sure if a value of `2' is big/small
enough, but it's what the defaults seem to use).

Comments (0)

Files changed (2)

Criterion/Plot.hs

     bottomAxis = laxis_title ^= "number of samples"
                $ defaultLayoutAxis
 
-    bars = plot_bars_values ^= (zip [0.5,1.5..] . map (:[]) . fromU $ times)
+    bars = plot_bars_values ^= (zip [0.5,1.5..] . map (:[]) . U.toList $ times)
          $ plot_bars_item_styles ^= [ (solidFillStyle c, Nothing) | c <- defaultColorSeq ]
-         $ plot_bars_spacing ^= BarsFixGap 0
+         $ plot_bars_spacing ^= BarsFixGap 0 2
          $ defaultPlotBars
 
-renderKDE :: String -> Maybe (Double :*: Double) -> Points -> UArr Double
+renderKDE :: String -> Maybe (Double, Double) -> Points -> U.Vector Double
           -> Renderable ()
 renderKDE desc exs points pdf = toRenderable layout
   where
                $ defaultLayoutAxis
 
     semiAutoScaledAxis opts ps = autoScaledAxis opts (extremities ++ ps)
-    extremities = maybe [] (\(lo :*: hi) -> [lo, hi]) exs
+    extremities = maybe [] (\(lo, hi) -> [lo, hi]) exs
 
-    info = plot_lines_values ^= [zip (fromU (fromPoints points)) (fromU spdf)]
+    info = plot_lines_values ^= [zip (U.toList (fromPoints points)) (U.toList spdf)]
          $ defaultPlotLines
 
     -- Normalise the PDF estimates into a semi-sane range.
-    spdf = mapU (/ sumU pdf) pdf
+    spdf = U.map (/ U.sum pdf) pdf
 
 -- | An axis whose labels display as seconds (or fractions thereof).
 secAxis :: LinearAxisParams Double
 
   if flag(chart)
     build-depends:
-      Chart >= 0.12,
+      Chart >= 0.13 && < 0.14,
       data-accessor
     cpp-options: -DHAVE_CHART
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.