-- 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. -- -- Start a simple session with make ghci. This loads the module -- Graphics.Gnuplot.Simple which is ready for use in GHCi. It does -- not address all fancy gnuplot features in order to stay simple. For -- more sophisticated plots, especially batch generated graphics, I -- recommend Graphics.Gnuplot.Advanced. -- -- With the Cabal flags executePipe and executeShell you can switch to -- more convenient but probably less portable ways of running gnuplot. -- -- In the past this was part of the htam package. @package gnuplot @version 0.3.3.1 module Graphics.Gnuplot.Frame.Option newtype T Cons :: String -> T newtype T Cons :: String -> T custom :: String -> T title :: T grid :: T size :: T key :: T border :: T pm3d :: T xRange :: T yRange :: T zRange :: T xLabel :: T yLabel :: T zLabel :: T xTicks :: T yTicks :: T zTicks :: T 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)] -- | Modularized interface to gnuplot that allows complex graphics and fine -- control of their components. It is designed for non-interactive use, -- e.g. scripts for plotting statistics. -- -- The hierarchy of objects is as follows: -- --
-- list (take 30 (let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) in fibs)) --list :: (Show a) => [a] -> T -- |
-- function (linearScale 1000 (-10,10)) sin --function :: (Show a) => [a] -> (a -> a) -> T -- |
-- functions (linearScale 1000 (-10,10)) [sin, cos] --functions :: (Show a) => [a] -> [a -> a] -> T path :: (Show a) => [(a, a)] -> T -- |
-- parameterFunction (linearScale 1000 (0,2*pi)) (\t -> (sin (2*t), cos t)) --parameterFunction :: (Show a) => [a] -> (a -> (a, a)) -> T listFromFile :: FilePath -> Int -> T pathFromFile :: FilePath -> Int -> Int -> T -- | This is a simple monolithic interface to gnuplot that can be used as -- is in GHCi or Hugs. We do not plan to support every feature of gnuplot -- here, instead we provide an advanced modularized interface in -- Graphics.Gnuplot.Advanced. 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 -- | you cannot use this, call terminal instead Terminal :: T -> 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 terminal :: (C term) => term -> Attribute -- |
-- 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 [] (linearScale 1000 (0,2*pi)) [\t -> (sin (2*t), cos t), \t -> (cos t, sin (2*t))] --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