plot 0.1.1.2 → 0.1.1.3
raw patch · 4 files changed
+42/−24 lines, 4 files
Files
- CHANGES +4/−0
- lib/Graphics/Rendering/Plot/Render/Plot/Data.hs +17/−20
- lib/Graphics/Rendering/Plot/Render/Plot/Glyph.hs +20/−3
- plot.cabal +1/−1
CHANGES view
@@ -8,3 +8,7 @@ 0.1.1.2: * fixed examples for Scale (Log/Linear)++0.1.1.3:+ * fixed bug (lack of stroke) with datasets larger than window+ * hollow points fill with white
lib/Graphics/Rendering/Plot/Render/Plot/Data.hs view
@@ -313,20 +313,20 @@ then (findMinIdx t xmin 0 (ln-1) ,findMaxIdx t xmax (ln-1) 0 ,xmax_ix - xmin_ix + 1)- else (0,ln-1,1)- diff'' = (fromIntegral num_pts)/w- diff' = round $ if diff'' <= 1 then 1 else diff''+ else (0,ln-1,ln)+ diff'' = floor $ (fromIntegral num_pts)/w+ diff' = if diff'' <= 1 then 1 else diff'' diff = if m then diff' else 1 cairo $ do case s of Nothing -> C.moveTo (t @> xmin_ix) (y @> xmin_ix) Just s' -> s'- _ <- runMaybeT $ mapVectorWithIndexM_ (\i y' -> do- when (i >= xmin_ix && i `mod` diff == 0)- (do- renderSample i xmax_ix t f e y')- return ()) y- return ()+ _ <- runMaybeT $ do+ mapVectorWithIndexM_ (\i y' -> do+ when (i >= xmin_ix && i `mod` diff == 0)+ (renderSample i xmax_ix t f y')+ return ()) y+ e ----------------------------------------------------------------------------- @@ -342,9 +342,9 @@ then (findMinIdx t xmin 0 (ln-1) ,findMaxIdx t xmax (ln-1) 0 ,xmax_ix - xmin_ix + 1)- else (0,ln-1,1)- diff'' = (fromIntegral num_pts)/w- diff' = round $ if diff'' <= 1 then 1 else diff''+ else (0,ln-1,ln)+ diff'' = floor $ (fromIntegral num_pts)/w+ diff' = if diff'' <= 1 then 1 else diff'' diff = if m then diff' else 1 cairo $ do case s of@@ -352,21 +352,18 @@ Just s' -> s' _ <- runMaybeT $ mapVectorWithIndexM_ (\i t -> do when (i >= xmin_ix && i `mod` diff == 0)- (do- renderMinMaxSample i xmax_ix t f e y)+ (renderMinMaxSample i xmax_ix t f e y) return ()) t return () ----------------------------------------------------------------------------- renderSample :: Int -> Int -> Vector Double - -> (Double -> Double -> C.Render ()) -> C.Render () + -> (Double -> Double -> C.Render ()) -> Double -> MaybeT C.Render ()-renderSample ix xmax_ix t f e y+renderSample ix xmax_ix t f y | ix >= xmax_ix = do- lift $ do- f (t @> ix) y- e+ lift $ f (t @> ix) y fail "end of bounded area" | otherwise = do lift $ f (t @> ix) y@@ -499,7 +496,7 @@ {-# INLINE monoStep #-} isMonotoneIncreasing :: Vector Double -> Bool-isMonotoneIncreasing v = maybe False (\_ -> True) $ evalState (runMaybeT $ (mapVectorM_ monoStep v)) (v @> 0)+isMonotoneIncreasing v = maybe False (\_ -> True) $ evalState (runMaybeT $ (mapVectorM_ monoStep (subVector 1 (dim v -1) v))) (v @> 0) -----------------------------------------------------------------------------
lib/Graphics/Rendering/Plot/Render/Plot/Glyph.hs view
@@ -60,7 +60,11 @@ C.relLineTo x 0 C.relLineTo 0 (-y) C.closePath- C.stroke+ C.strokePreserve+ C.save+ C.setSourceRGBA 1 1 1 1+ C.fill+ C.restore renderGlyphCross :: C.Render () renderGlyphCross = do@@ -82,6 +86,11 @@ C.relLineTo (x/2) (-y) C.relLineTo (-x/2) (-y) C.closePath+ C.strokePreserve+ C.save+ C.setSourceRGBA 1 1 1 1+ C.fill+ C.restore C.stroke renderGlyphAsterisk :: C.Render ()@@ -109,7 +118,11 @@ C.relMoveTo sx sy mapM_ (uncurry C.relLineTo) (zip xs ys) C.closePath- C.stroke+ C.strokePreserve+ C.save+ C.setSourceRGBA 1 1 1 1+ C.fill+ C.restore renderGlyphCircle :: C.Render () renderGlyphCircle = do@@ -122,7 +135,11 @@ C.relMoveTo sx sy mapM_ (uncurry C.relLineTo) (zip xs ys) C.closePath- C.stroke+ C.strokePreserve+ C.save+ C.setSourceRGBA 1 1 1 1+ C.fill+ C.restore renderGlyphBullet :: C.Render () renderGlyphBullet = do
plot.cabal view
@@ -1,5 +1,5 @@ Name: plot-Version: 0.1.1.2+Version: 0.1.1.3 License: BSD3 License-file: LICENSE Copyright: (c) A.V.H. McPhail 2010