plot 0.2.3.6 → 0.2.3.7
raw patch · 8 files changed
+20/−12 lines, 8 files
Files
- CHANGES +2/−0
- THANKS +1/−0
- lib/Graphics/Rendering/Plot/Figure.hs +1/−1
- lib/Graphics/Rendering/Plot/Figure/Plot.hs +2/−2
- lib/Graphics/Rendering/Plot/Figure/Plot/Data.hs +8/−4
- lib/Graphics/Rendering/Plot/Render/Plot/Data.hs +1/−1
- lib/Graphics/Rendering/Plot/Types.hs +3/−2
- plot.cabal +2/−2
CHANGES view
@@ -132,3 +132,5 @@ 0.2.3.5: * update for hmatrix 0.17 +0.2.3.7:+ * implement vector functions thanks to alang9 on github
THANKS view
@@ -5,3 +5,4 @@ non-default point size and legend placement/scaling * pacak updated for AMP for ghc 7.10 * pacak - clean up warnings and simplify dependencies+ * alang9 - implement vector functions
lib/Graphics/Rendering/Plot/Figure.hs view
@@ -51,7 +51,7 @@ , setPlotPadding , withHeading -- ** Series data- , Function(), Series(), MinMaxSeries(), ErrorSeries()+ , Function(), VectorFunction(), Series(), MinMaxSeries(), ErrorSeries() , Surface() , SeriesLabel() , Abscissa(), Ordinate(), Dataset()
lib/Graphics/Rendering/Plot/Figure/Plot.hs view
@@ -284,10 +284,10 @@ findMinMax :: Abscissae -> Ordinates -> (Double,Double) findMinMax (AbsFunction _) (OrdFunction _ f _) = - let v = cmap f (linspace 100 (-1,1))+ let v = f (linspace 100 (-1,1)) in (minElement v,maxElement v) findMinMax (AbsPoints _ x) (OrdFunction _ f _) = - let v = cmap f x+ let v = f x in (minElement v,maxElement v) -- what if errors go beyond plot? findMinMax _ (OrdPoints _ (Plain o) _) = (minElement o,maxElement o)
lib/Graphics/Rendering/Plot/Figure/Plot/Data.hs view
@@ -528,22 +528,26 @@ toOrdinates :: Ordinate a => [a] -> [Ordinates] toOrdinates = map toOrdinate -instance Ordinate Function where toOrdinate f = OrdFunction Lower f Nothing+instance Ordinate Function where toOrdinate f = OrdFunction Lower (cmap f) Nothing+instance Ordinate VectorFunction where toOrdinate f = OrdFunction Lower f Nothing instance Ordinate Series where toOrdinate s = OrdPoints Lower (Plain s) Nothing instance Ordinate (Series,ErrorSeries) where toOrdinate (s,e) = OrdPoints Lower (Error s (Left e)) Nothing instance Ordinate (Series,(ErrorSeries,ErrorSeries)) where toOrdinate (s,(l,u)) = OrdPoints Lower (Error s (Right (l,u))) Nothing instance Ordinate (MinMaxSeries,(ErrorSeries,ErrorSeries)) where toOrdinate (s,(l,u)) = OrdPoints Lower (MinMax s (Just (l,u))) Nothing-instance Ordinate (Function,AxisSide) where toOrdinate (f,ax) = OrdFunction ax f Nothing+instance Ordinate (Function,AxisSide) where toOrdinate (f,ax) = OrdFunction ax (cmap f) Nothing+instance Ordinate (VectorFunction,AxisSide) where toOrdinate (f,ax) = OrdFunction ax f Nothing instance Ordinate (Series,AxisSide) where toOrdinate (s,ax) = OrdPoints ax (Plain s) Nothing instance Ordinate (Series,ErrorSeries,AxisSide) where toOrdinate (s,e,ax) = OrdPoints ax (Error s (Left e)) Nothing instance Ordinate (Series,(ErrorSeries,ErrorSeries),AxisSide) where toOrdinate (s,(l,u),ax) = OrdPoints ax (Error s (Right (l,u))) Nothing instance Ordinate (MinMaxSeries,(ErrorSeries,ErrorSeries),AxisSide) where toOrdinate (s,(l,u),ax) = OrdPoints ax (MinMax s (Just (l,u))) Nothing-instance Ordinate (Function,SeriesLabel) where toOrdinate (f,la) = OrdFunction Lower f (Just la)+instance Ordinate (Function,SeriesLabel) where toOrdinate (f,la) = OrdFunction Lower (cmap f) (Just la)+instance Ordinate (VectorFunction,SeriesLabel) where toOrdinate (f,la) = OrdFunction Lower f (Just la) instance Ordinate (Series,SeriesLabel) where toOrdinate (s,la) = OrdPoints Lower (Plain s) (Just la) instance Ordinate (Series,ErrorSeries,SeriesLabel) where toOrdinate (s,e,la) = OrdPoints Lower (Error s (Left e)) (Just la) instance Ordinate (Series,(ErrorSeries,ErrorSeries),SeriesLabel) where toOrdinate (s,(l,u),la) = OrdPoints Lower (Error s (Right (l,u))) (Just la) -instance Ordinate (Function,AxisSide,SeriesLabel) where toOrdinate (f,ax,la) = OrdFunction ax f (Just la)+instance Ordinate (Function,AxisSide,SeriesLabel) where toOrdinate (f,ax,la) = OrdFunction ax (cmap f) (Just la)+instance Ordinate (VectorFunction,AxisSide,SeriesLabel) where toOrdinate (f,ax,la) = OrdFunction ax f (Just la) instance Ordinate (Series,AxisSide,SeriesLabel) where toOrdinate (s,ax,la) = OrdPoints ax (Plain s) (Just la) instance Ordinate (Series,ErrorSeries,AxisSide,SeriesLabel) where toOrdinate (s,e,ax,la) = OrdPoints ax (Error s (Left e)) (Just la) instance Ordinate (Series,(ErrorSeries,ErrorSeries),AxisSide,SeriesLabel) where toOrdinate (s,(l,u),ax,la) = OrdPoints ax (Error s (Right (l,u))) (Just la)
lib/Graphics/Rendering/Plot/Render/Plot/Data.hs view
@@ -273,7 +273,7 @@ (OrdFunction _ f _) -> do (BoundingBox _ _ w _) <- get let t = logSeries xsc $ linspace (round w) (xmin,xmax)- return $ Left $ Left ((True,t),logSeries ysc $ cmap f t)+ return $ Left $ Left ((True,t),logSeries ysc $ f t) (OrdPoints _ (Plain o') _) -> do let t = case abs of AbsFunction f ->
lib/Graphics/Rendering/Plot/Types.hs view
@@ -285,7 +285,8 @@ type Surface = Matrix Double type ErrorSeries = Series type MinMaxSeries = (Series,Series)-type Function = (Double -> Double)+type Function = Double -> Double+type VectorFunction = Vector Double -> Vector Double type SeriesLabel = String @@ -313,7 +314,7 @@ data Abscissae = AbsFunction AbsFunctionModifier | AbsPoints MonotoneIncreasing Series -data Ordinates = OrdFunction AxisSide Function (Maybe SeriesLabel)+data Ordinates = OrdFunction AxisSide VectorFunction (Maybe SeriesLabel) | OrdPoints AxisSide OrdSeries (Maybe SeriesLabel) getOrdLabel :: Ordinates -> (Maybe SeriesLabel)
plot.cabal view
@@ -1,8 +1,8 @@ Name: plot-Version: 0.2.3.6+Version: 0.2.3.7 License: BSD3 License-file: LICENSE-Copyright: (c) A.V.H. McPhail 2010, 2012, 2013, 2014, 2015+Copyright: (c) A.V.H. McPhail 2010, 2012, 2013, 2014, 2015, 2016, 2017 Author: Vivian McPhail Maintainer: haskell.vivian.mcphail <at> gmail <dot> com Stability: experimental