Definitions of various types of Plots we can put on a 2D Chart.
Note that template haskell is used to derive accessor functions
(see Data.Accessor
) for each field of the following data types:
These accessors are not shown in this API documentation. They have the same name as the field, but with the trailing underscore dropped. Hence for data field f_::F in type D, they have type
f :: Data.Accessor.Accessor D F
- data Plot x y = Plot {
- plot_render_ :: PointMapFn x y -> CRender ()
- plot_legend_ :: [(String, Rect -> CRender ())]
- plot_all_points_ :: ([x], [y])
- joinPlot :: Plot x y -> Plot x y -> Plot x y
- class ToPlot a where
- data PlotPoints x y = PlotPoints {
- plot_points_title_ :: String
- plot_points_style_ :: CairoPointStyle
- plot_points_values_ :: [(x, y)]
- defaultPlotPoints :: PlotPoints x y
- data PlotLines x y = PlotLines {
- plot_lines_title_ :: String
- plot_lines_style_ :: CairoLineStyle
- plot_lines_values_ :: [[(x, y)]]
- plot_lines_limit_values_ :: [[(Limit x, Limit y)]]
- defaultPlotLines :: PlotLines x y
- defaultPlotLineStyle :: CairoLineStyle
- hlinePlot :: String -> CairoLineStyle -> b -> Plot a b
- vlinePlot :: String -> CairoLineStyle -> a -> Plot a b
- data PlotErrBars x y = PlotErrBars {}
- defaultPlotErrBars :: PlotErrBars x y
- data ErrPoint x y = ErrPoint {}
- data ErrValue x = ErrValue {}
- symErrPoint :: (Num a, Num b) => a -> b -> a -> b -> ErrPoint a b
- data PlotFillBetween x y = PlotFillBetween {
- plot_fillbetween_title_ :: String
- plot_fillbetween_style_ :: CairoFillStyle
- plot_fillbetween_values_ :: [(x, (y, y))]
- defaultPlotFillBetween :: PlotFillBetween x y
- data PlotBars x y = PlotBars {}
- defaultPlotBars :: BarsPlotValue y => PlotBars x y
- data PlotBarsStyle
- data PlotBarsSpacing
- data PlotBarsAlignment
- = BarsLeft
- | BarsCentered
- | BarsRight
- class PlotValue a => BarsPlotValue a where
- barsReference :: a
- barsAdd :: a -> a -> a
- data PlotHidden x y = PlotHidden {
- plot_hidden_x_values_ :: [x]
- plot_hidden_y_values_ :: [y]
- data PlotAnnotation x y = PlotAnnotation {}
- defaultPlotAnnotation :: PlotAnnotation x y
- plot_lines_title :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) String
- plot_lines_style :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) CairoLineStyle
- plot_lines_values :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) ([] ([] ((,) x[awUc] y[awUd])))
- plot_lines_limit_values :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) ([] ([] ((,) (Limit x[awUc]) (Limit y[awUd]))))
- plot_render :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) (PointMapFn x[awUh] y[awUi] -> CRender ())
- plot_legend :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) ([] ((,) String (Rect -> CRender ())))
- plot_all_points :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) ((,) ([] x[awUh]) ([] y[awUi]))
- plot_points_title :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) String
- plot_points_style :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) CairoPointStyle
- plot_points_values :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) ([] ((,) x[awUa] y[awUb]))
- plot_fillbetween_title :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) String
- plot_fillbetween_style :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) CairoFillStyle
- plot_fillbetween_values :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) ([] ((,) x[awU8] ((,) y[awU9] y[awU9])))
- plot_errbars_title :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) String
- plot_errbars_line_style :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) CairoLineStyle
- plot_errbars_tick_length :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) Double
- plot_errbars_overhang :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) Double
- plot_errbars_values :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) ([] (ErrPoint x[awU3] y[awU4]))
- plotBars :: BarsPlotValue y => PlotBars x y -> Plot x y
- plot_bars_style :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsStyle
- plot_bars_item_styles :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] ((,) CairoFillStyle (Maybe CairoLineStyle)))
- plot_bars_titles :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] String)
- plot_bars_spacing :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsSpacing
- plot_bars_alignment :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsAlignment
- plot_bars_reference :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) y[awU1]
- plot_bars_singleton_width :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) Double
- plot_bars_values :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] ((,) x[awU0] ([] y[awU1])))
- plot_annotation_hanchor :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) HTextAnchor
- plot_annotation_vanchor :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) VTextAnchor
- plot_annotation_angle :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) Double
- plot_annotation_style :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) CairoFontStyle
- plot_annotation_values :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) ([] ((,,) x[awTW] y[awTX] String))
Plot
Interface to control plotting on a 2D area.
Plot | |
|
joinPlot :: Plot x y -> Plot x y -> Plot x ySource
Join any two plots together (they will share a legend).
Typeclass for casting to plot
A type class abstracting the conversion of a value to a Plot.
Point plots
data PlotPoints x y Source
Value defining a series of datapoints, and a style in which to render them.
PlotPoints | |
|
Lines plot
Value defining a series of (possibly disjointed) lines, and a style in which to render them.
PlotLines | |
|
defaultPlotLines :: PlotLines x ySource
hlinePlot :: String -> CairoLineStyle -> b -> Plot a bSource
Helper function to plot a single horizontal line.
vlinePlot :: String -> CairoLineStyle -> a -> Plot a bSource
Helper function to plot a single vertical line.
Plot with error bars
data PlotErrBars x y Source
Value defining a series of error intervals, and a style in which to render them.
Value for holding a point with associated error bounds for each axis.
symErrPoint :: (Num a, Num b) => a -> b -> a -> b -> ErrPoint a bSource
When the error is symmetric, we can simply pass in dx for the error.
Plot with filled area
data PlotFillBetween x y Source
Value specifying a plot filling the area between two sets of Y coordinates, given common X coordinates.
PlotFillBetween | |
|
Bar plots
Value describing how to plot a set of bars. Note that the input data is typed [(x,[y])], ie for each x value we plot several y values. Typically the size of each [y] list would be the same.
PlotBars | |
|
defaultPlotBars :: BarsPlotValue y => PlotBars x ySource
data PlotBarsStyle Source
BarsStacked | Bars for a fixed x are stacked vertically on top of each other. |
BarsClustered | Bars for a fixed x are put horizontally beside each other. |
data PlotBarsSpacing Source
BarsFixWidth Double | All bars have the same width in pixels. |
BarsFixGap Double Double | (BarsFixGap g mw) means make the gaps between the bars equal to g, but with a minimum bar width of mw |
data PlotBarsAlignment Source
How bars for a given (x,[y]) are aligned with respect to screen coordinate corresponding to x (deviceX).
BarsLeft | The left edge of bars is at deviceX |
BarsCentered | The right edge of bars is at deviceX |
BarsRight | Bars are centered around deviceX |
class PlotValue a => BarsPlotValue a whereSource
barsReference :: aSource
Invisible plot
data PlotHidden x y Source
Value defining some hidden x and y values. The values don't get displayed, but still affect axis scaling.
PlotHidden | |
|
data PlotAnnotation x y Source
Value for describing a series of text annotations to be placed at arbitrary points on the graph. Annotations can be rotated and styled. Rotation angle is given in degrees, rotation is performend around the anchor point.
Accessors
These accessors are generated by template haskell
plot_lines_title :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) StringSource
plot_lines_style :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) CairoLineStyleSource
plot_lines_values :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) ([] ([] ((,) x[awUc] y[awUd])))Source
plot_lines_limit_values :: forall x[awUc] y[awUd]. T (PlotLines x[awUc] y[awUd]) ([] ([] ((,) (Limit x[awUc]) (Limit y[awUd]))))Source
plot_render :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) (PointMapFn x[awUh] y[awUi] -> CRender ())Source
plot_legend :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) ([] ((,) String (Rect -> CRender ())))Source
plot_all_points :: forall x[awUh] y[awUi]. T (Plot x[awUh] y[awUi]) ((,) ([] x[awUh]) ([] y[awUi]))Source
plot_points_title :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) StringSource
plot_points_style :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) CairoPointStyleSource
plot_points_values :: forall x[awUa] y[awUb]. T (PlotPoints x[awUa] y[awUb]) ([] ((,) x[awUa] y[awUb]))Source
plot_fillbetween_title :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) StringSource
plot_fillbetween_style :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) CairoFillStyleSource
plot_fillbetween_values :: forall x[awU8] y[awU9]. T (PlotFillBetween x[awU8] y[awU9]) ([] ((,) x[awU8] ((,) y[awU9] y[awU9])))Source
plot_errbars_title :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) StringSource
plot_errbars_line_style :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) CairoLineStyleSource
plot_errbars_tick_length :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) DoubleSource
plot_errbars_overhang :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) DoubleSource
plot_errbars_values :: forall x[awU3] y[awU4]. T (PlotErrBars x[awU3] y[awU4]) ([] (ErrPoint x[awU3] y[awU4]))Source
plotBars :: BarsPlotValue y => PlotBars x y -> Plot x ySource
plot_bars_style :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsStyleSource
plot_bars_item_styles :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] ((,) CairoFillStyle (Maybe CairoLineStyle)))Source
plot_bars_titles :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] String)Source
plot_bars_spacing :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsSpacingSource
plot_bars_alignment :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) PlotBarsAlignmentSource
plot_bars_reference :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) y[awU1]Source
plot_bars_singleton_width :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) DoubleSource
plot_bars_values :: forall x[awU0] y[awU1]. T (PlotBars x[awU0] y[awU1]) ([] ((,) x[awU0] ([] y[awU1])))Source
plot_annotation_hanchor :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) HTextAnchorSource
plot_annotation_vanchor :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) VTextAnchorSource
plot_annotation_angle :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) DoubleSource
plot_annotation_style :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) CairoFontStyleSource
plot_annotation_values :: forall x[awTW] y[awTX]. T (PlotAnnotation x[awTW] y[awTX]) ([] ((,,) x[awTW] y[awTX] String))Source