summaryrefslogtreecommitdiff
path: root/lib/Graphics
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-09-05 08:11:17 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-09-05 08:11:17 +0000
commitfa4e2233a873bbfee26939c013b56acc160bca7b (patch)
treeba2152dfd8ae8ffa6ead19c1924747c2134a3190 /lib/Graphics
parentb59a56c22f7e4aa518046c41e049e5bf1cdf8204 (diff)
refactor Numeric Vector/Matrix and classes
Diffstat (limited to 'lib/Graphics')
-rw-r--r--lib/Graphics/Plot.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs
index 2dc0553..478b4ad 100644
--- a/lib/Graphics/Plot.hs
+++ b/lib/Graphics/Plot.hs
@@ -150,8 +150,8 @@ matrixToPGM m = header ++ unlines (map unwords ll) where
150 r = rows m 150 r = rows m
151 header = "P2 "++show c++" "++show r++" "++show (round maxgray :: Int)++"\n" 151 header = "P2 "++show c++" "++show r++" "++show (round maxgray :: Int)++"\n"
152 maxgray = 255.0 152 maxgray = 255.0
153 maxval = vectorMax $ flatten $ m 153 maxval = maxElement m
154 minval = vectorMin $ flatten $ m 154 minval = minElement m
155 scale' = if (maxval == minval) 155 scale' = if (maxval == minval)
156 then 0.0 156 then 0.0
157 else maxgray / (maxval - minval) 157 else maxgray / (maxval - minval)