-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A plotting library, exportable as eps/pdf/svg/png or renderable with gtk -- -- A package for creating plots, built on top of the Cairo rendering -- engine. -- -- An ambitious attempt to replace gnuplot. -- -- Monadic actions are used to configure a figure, which is a (rxc) array -- of subplots. Each plot displays a graph with optional heading, labels, -- legend, and annotations. The annotations themselves may be used to -- draw diagrams. -- -- A figure is preprocessed in preparation for rendering by the Cairo -- renderer. The Cairo library can be used to output the figure to PS, -- PDF, SVG, and PNG file formats, or to display the figure in a GTK -- Drawable context. (see package 'plot-gtk'). -- -- The preprocessed figure can be embedded as an arbitrary Cairo render, -- including in a diagram created with the diagram package. Conversely, -- arbitrary Cairo renders can be embedded in the data region of a -- Figure. -- -- The data series are type Data.Packed.Vector from hmatrix, -- which, when hmatrix is compiled with '-fvector', is a synonym for -- Data.Vector.Storable from the vector package and are thus -- compatible with packages such as statistics. -- -- The example in Graphics.Rendering.Plot can be viewed at -- http://code.haskell.org/plot/examples/perturbed-sine.png -- -- Changes in plot 0.1.1 -- --
-- setDataset (ts,[linespoints (xs,(le,ue),Upper,"data") (([Dash,Dash],3,blue),(Diamond,green))]) ---- -- has abscissa ts paired with a list of ordinate series, the -- single element of which is a FormattedSeries, -- linespoints where the ordinate is xs with error -- series le and ue, to be graphed against the upper -- y-range with label "data". The line element is formatted to be dashed, -- of width 3, and blue and the point element is to be a green diamond. setDataset :: Dataset a => a -> Plot () type Location = (Double, Double) type Head = Bool type Fill = Bool data Annote a -- | add an arrow arrow :: Head -> Location -> Location -> Line () -> Annote () -- | add an oval oval :: Fill -> Location -> Location -> Bar () -> Annote () -- | add a rectangle rect :: Fill -> Location -> Location -> Bar () -> Annote () -- | add a rectangle glyph :: Location -> Point () -> Annote () -- | add text text :: Location -> Text () -> Annote () -- | add a cairo render that takes the bounding box (in user coordinates) -- as an argument cairo :: (Double -> Double -> Double -> Double -> Render ()) -> Annote () withAnnotations :: Annote () -> Plot () -- | set the plot type of a given data series setSeriesType :: Int -> SeriesType -> Plot () -- | change the plot type of all data series setAllSeriesTypes :: SeriesType -> Plot () class PlotFormats m -- | format the plot elements of a given series withSeriesFormat :: PlotFormats m => Int -> m () -> Plot () -- | format the plot elements of all series -- -- the operation to modify the formats is passed the series index. This -- allows, for example, colours to be selected from a list that gets -- indexed by the argument -- --
-- setColour = withAllSeriesFormats (\i -> do -- setLineColour $ [black,blue,red,green,yellow] !! i -- setLineWidth 1.0) --withAllSeriesFormats :: PlotFormats m => (Int -> m ()) -> Plot () data Scale Linear :: Scale Log :: Scale -- | set the axis range setRange :: AxisType -> AxisSide -> Scale -> Double -> Double -> Plot () -- | set the axis ranges to values based on dataset setRangeFromData :: AxisType -> AxisSide -> Scale -> Plot () data Axis a data AxisType XAxis :: AxisType YAxis :: AxisType data AxisSide Lower :: AxisSide Upper :: AxisSide data AxisPosn Side :: AxisSide -> AxisPosn Value :: Double -> AxisPosn -- | clear the axes of a subplot clearAxes :: Plot () -- | clear an axis of a subplot clearAxis :: AxisType -> AxisPosn -> Plot () -- | add an axis to the subplot addAxis :: AxisType -> AxisPosn -> Axis () -> Plot () -- | operate on the given axis withAxis :: AxisType -> AxisPosn -> Axis () -> Plot () data Legend a type LegendBorder = Bool data LegendLocation North :: LegendLocation NorthEast :: LegendLocation East :: LegendLocation SouthEast :: LegendLocation South :: LegendLocation SouthWest :: LegendLocation West :: LegendLocation NorthWest :: LegendLocation data LegendOrientation Inside :: LegendOrientation Outside :: LegendOrientation -- | clear the legend clearLegend :: Plot () -- | set the legend location and orientation setLegend :: LegendBorder -> LegendLocation -> LegendOrientation -> Plot () -- | format the legend text withLegendFormat :: Text () -> Plot () data Tick Minor :: Tick Major :: Tick type TickValues = Either Int (Vector Double) type GridLines = Bool -- | format the axis ticks setTicks :: Tick -> TickValues -> Axis () -- | should gridlines be displayed? setGridlines :: Tick -> GridLines -> Axis () -- | printf format that takes one argument, the tick value setTickLabelFormat :: String -> Axis () -- | operate on the axis label withAxisLabel :: Text () -> Axis () -- | format the axis line withAxisLine :: Line () -> Axis () -- | format the grid lines withGridLine :: Tick -> Line () -> Axis () data Line a class LineFormat a type DashStyle = [Dash] data Dash Dot :: Dash Dash :: Dash type LineWidth = Double -- | clear the formatting of a line clearLineFormat :: Line () -- | change the dash style of a line setDashStyle :: DashStyle -> Line () -- | change the line width of a line setLineWidth :: LineWidth -> Line () -- | change the line colour of a line setLineColour :: Color -> Line () data Point a class PointFormat a data Glyph Box :: Glyph Cross :: Glyph Diamond :: Glyph Asterisk :: Glyph Triangle :: Glyph Circle :: Glyph Bullet :: Glyph Top :: Glyph Bot :: Glyph type PointSize = Double -- | change the glyph of a point setGlyph :: Glyph -> Point () -- | change the size of a point setPointSize :: PointSize -> Point () -- | change the colour of a point setPointColour :: Color -> Point () data Bar a class BarFormat a -- | clear the formatting of a line clearBarFormat :: Bar () -- | set the width of the bar setBarWidth :: Width -> Bar () -- | set the colour of the bar setBarColour :: Color -> Bar () -- | set the width of the bar border setBarBorderWidth :: LineWidth -> Bar () -- | set the colour of the bar border setBarBorderColour :: Color -> Bar () data Text a type FontFamily = String type FontSize = Double type Color = Colour Double -- | clear the text entry clearText :: Text () -- | set the text formatting to the default clearTextFormat :: Text () -- | set the value of a text entry setText :: String -> Text () -- | set the font style of a text entry setFontFamily :: FontFamily -> Text () -- | set the font style of a text entry setFontStyle :: FontStyle -> Text () -- | set the font variant of a text entry setFontVariant :: Variant -> Text () -- | set the font weight of a text entry setFontWeight :: Weight -> Text () -- | set the font stretch of a text entry setFontStretch :: Stretch -> Text () -- | set the font size of a text entry setFontSize :: FontSize -> Text () -- | set the colour of a text entry setFontColour :: Color -> Text () -- | One line Figure creation module Graphics.Rendering.Plot.Figure.Simple -- | create a figure with a single linear plot with lower X and Y axes -- whose ranges are set from the data plot :: Dataset d => d -> Figure () -- | create a figure with a single log-log plot with lower X and Y axes -- whose ranges are set from the data loglog :: Dataset d => d -> Figure () -- | create a figure with a single linear-log plot with lower X and Y axes -- whose ranges are set from the data semilog :: Dataset d => d -> Figure () -- | create a figure with a single parametric plot over n points with lower -- X and Y axes whose ranges are set from the data parametric :: (Double -> Double, Double -> Double) -> (Double, Double) -> Int -> Figure () -- | set the title title :: String -> Figure () -- | set the subtitle subtitle :: String -> Figure () class Simple m -- | set the gridlines grid :: Simple m => Bool -> m () -- | set the x range xrange :: Simple m => Scale -> Double -> Double -> m () -- | set the y range yrange :: Simple m => Scale -> Double -> Double -> m () -- | set the x range from data xautorange :: Simple m => m () -- | set the y range from data yautorange :: Simple m => m () -- | set the x range from data xautorangeLog :: Simple m => m () -- | set the y range from data yautorangeLog :: Simple m => m () -- | set the x label xlabel :: Simple m => String -> m () -- | set the y label ylabel :: Simple m => String -> m () instance Simple Figure instance Simple Plot -- | Graphical plots module Graphics.Rendering.Plot