-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | 2D and 3D plots using gnuplot -- -- This is a wrapper to gnuplot which lets you create 2D and 3D plots. -- -- With the Cabal flags executePipe and executeShell you can switch to -- more convenient but probably less portable ways of running gnuplot. -- -- Start a simple session with make ghci. -- -- In the past this was part of the htam package. @package gnuplot @version 0.3 module Graphics.Gnuplot.Time -- | Use it this way: -- --
-- import Data.Time -- import Graphics.Gnuplot.Simple -- -- main = -- plotPath [XTime, XFormat "%m-%d"] $ prepXTime $ -- (UTCTime (fromGregorian 2008 01 01) 0, 1.0) : -- (UTCTime (fromGregorian 2008 01 05) 43200, 5.0) : -- (UTCTime (fromGregorian 2008 01 15) 0, 2.5) : -- [] --prepXTime :: (FormatTime a, Read b) => [(a, b)] -> [(b, b)] module Graphics.Gnuplot.Simple data Attribute -- | anything that is allowed after gnuplot's set command Custom :: String -> [String] -> Attribute EPS :: FilePath -> Attribute PNG :: FilePath -> Attribute Grid :: (Maybe [String]) -> Attribute Key :: (Maybe [String]) -> Attribute Border :: (Maybe [String]) -> Attribute XTicks :: (Maybe [String]) -> Attribute YTicks :: (Maybe [String]) -> Attribute Size :: (Size) -> Attribute Aspect :: (Aspect) -> Attribute BoxAspect :: (Aspect) -> Attribute LineStyle :: Int -> [LineAttr] -> Attribute Title :: String -> Attribute XLabel :: String -> Attribute YLabel :: String -> Attribute XRange :: (Double, Double) -> Attribute YRange :: (Double, Double) -> Attribute ZRange :: (Double, Double) -> Attribute Palette :: [(Double, (Double, Double, Double))] -> Attribute ColorBox :: (Maybe [String]) -> Attribute XTime :: Attribute XFormat :: String -> Attribute data Size Scale :: Double -> Size SepScale :: Double -> Double -> Size data Aspect Ratio :: Double -> Aspect NoRatio :: Aspect data LineAttr LineType :: Int -> LineAttr LineWidth :: Double -> LineAttr PointType :: Int -> LineAttr PointSize :: Double -> LineAttr LineTitle :: String -> LineAttr data LineSpec DefaultStyle :: Int -> LineSpec CustomStyle :: [LineAttr] -> LineSpec data PlotType Lines :: PlotType Points :: PlotType LinesPoints :: PlotType Impulses :: PlotType Dots :: PlotType Steps :: PlotType FSteps :: PlotType HiSteps :: PlotType ErrorBars :: PlotType XErrorBars :: PlotType YErrorBars :: PlotType XYErrorBars :: PlotType ErrorLines :: PlotType XErrorLines :: PlotType YErrorLines :: PlotType XYErrorLines :: PlotType Boxes :: PlotType FilledCurves :: PlotType BoxErrorBars :: PlotType BoxXYErrorBars :: PlotType FinanceBars :: PlotType CandleSticks :: PlotType Vectors :: PlotType PM3d :: PlotType data PlotStyle PlotStyle :: PlotType -> LineSpec -> PlotStyle plotType :: PlotStyle -> PlotType lineSpec :: PlotStyle -> LineSpec linearScale :: (Fractional a) => Integer -> (a, a) -> [a] defaultStyle :: PlotStyle -- |
-- plotList [] (take 30 (let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) in fibs)) --plotList :: (Show a) => [Attribute] -> [a] -> IO () plotListStyle :: (Show a) => [Attribute] -> PlotStyle -> [a] -> IO () plotLists :: (Show a) => [Attribute] -> [[a]] -> IO () plotListsStyle :: (Show a) => [Attribute] -> [(PlotStyle, [a])] -> IO () -- |
-- plotFunc [] (linearScale 1000 (-10,10)) sin --plotFunc :: (Show a) => [Attribute] -> [a] -> (a -> a) -> IO () -- |
-- plotFuncs [] (linearScale 1000 (-10,10)) [sin, cos] --plotFuncs :: (Show a) => [Attribute] -> [a] -> [a -> a] -> IO () plotPath :: (Show a) => [Attribute] -> [(a, a)] -> IO () plotPaths :: (Show a) => [Attribute] -> [[(a, a)]] -> IO () plotPathStyle :: (Show a) => [Attribute] -> PlotStyle -> [(a, a)] -> IO () plotPathsStyle :: (Show a) => [Attribute] -> [(PlotStyle, [(a, a)])] -> IO () -- |
-- plotParamFunc [] (linearScale 1000 (0,2*pi)) (\t -> (sin (2*t), cos t)) --plotParamFunc :: (Show a) => [Attribute] -> [a] -> (a -> (a, a)) -> IO () plotParamFuncs :: (Show a) => [Attribute] -> [a] -> [a -> (a, a)] -> IO () plotDots :: (Show a) => [Attribute] -> [(a, a)] -> IO () data Plot3dType Surface :: Plot3dType ColorMap :: Plot3dType data CornersToColor Mean :: CornersToColor GeometricMean :: CornersToColor Median :: CornersToColor Corner1 :: CornersToColor Corner2 :: CornersToColor Corner3 :: CornersToColor Corner4 :: CornersToColor data Attribute3d Plot3dType :: Plot3dType -> Attribute3d CornersToColor :: CornersToColor -> Attribute3d -- |
-- let xs = [-2,-1.8..2::Double] in plotMesh3d [] [] (do x <- xs; return (do y <- xs; return (x,y,cos(x*x+y*y)))) --plotMesh3d :: (Show a, Show b, Show c) => [Attribute] -> [Attribute3d] -> [[(a, b, c)]] -> IO () -- |
-- let xs = [-2,-1.8..2::Double] in plotFunc3d [] [] xs xs (\x y -> exp(-(x*x+y*y))) --plotFunc3d :: (Show a, Show b, Show c) => [Attribute] -> [Attribute3d] -> [b] -> [c] -> (b -> c -> a) -> IO () -- | Redirects the output of a plotting function to an EPS file and -- additionally converts it to PDF. epspdfPlot :: FilePath -> ([Attribute] -> IO ()) -> IO () -- | Creates an EPS and a PDF graphics and returns a string that can be -- inserted into a LaTeX document to include this graphic. -- -- Different from GHCi, Hugs doesn't output a return value from an IO -- monad. So you must wrap it with a putStr. Nevertheless this -- implementation which returns the LaTeX command as string is the most -- flexible one. inclPlot :: FilePath -> ([Attribute] -> IO ()) -> IO String