| Copyright | (c) Justin Le 2018 |
|---|---|
| License | BSD3 |
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Interactive.Plot.Series
Description
Create common serieses.
Synopsis
- type Series = SeriesF Identity
- type AutoSeries = SeriesF Auto
- data SeriesF f = Series {}
- type PointStyle = PointStyleF Identity
- type AutoPointStyle = PointStyleF Auto
- data PointStyleF f = PointStyleF {
- _psMarkerF :: f Char
- _psColorF :: f Color
- listSeries :: Foldable t => t Double -> PointStyleF f -> SeriesF f
- tupleSeries :: Foldable t => t (Double, Double) -> PointStyleF f -> SeriesF f
- funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyleF f -> SeriesF f
- enumRange :: Fractional a => Int -> Range a -> [a]
- fromAutoSeries :: [AutoSeries] -> [Series]
- fromAutoSeriesIO :: [AutoSeries] -> IO [Series]
- fromAutoSeries_ :: StdGen -> [AutoSeries] -> [Series]
- defaultStyles :: Set PointStyle
Documentation
type Series = SeriesF Identity Source #
Data for a single series: contains the coordinate map with the point style for the series.
type AutoSeries = SeriesF Auto Source #
A version of SeriesF where you can leave the marker or color blank,
to be automatically inferred.
A parameterized version of SeriesF to unify functions in
Interactive.Plot.Series.
Mainly you will be using either SeriesF or AutoSeries.
Constructors
| Series | |
Fields
| |
type PointStyle = PointStyleF Identity Source #
Specification of a style for a point.
Construct this wiht the PointStyle pattern synonym.
type AutoPointStyle = PointStyleF Auto Source #
A version of PointStyle where you can leave the marker or color
blank, to be automatically inferred.
You can construct this with the PointStyleF constructor.
It has a very convenient Monoid instance: mempty gives
a PointStyle where every field is Auto, and <> combines
PointStyles field-by-field, keeping the last Given.
data PointStyleF f Source #
A parameterized version of PointStyle to unify functions in
Interactive.Plot.Series.
Mainly you will be using either PointStyle or AutoPointStyle.
Constructors
| PointStyleF | |
Fields
| |
Instances
Create common SeriesF
listSeries :: Foldable t => t Double -> PointStyleF f -> SeriesF f Source #
Construct a series from any foldable container of y-values. The x-values are automatically assigned to 0, 1, 2, 3 ... etc.
Note that this is polymorphic over both PointStyle and
AutoPointStyle:
listSeries:: Foldable t => t Double ->PointStyle->SeriesFlistSeries:: Foldable t => t Double ->AutoPointStyle->AutoSeries
tupleSeries :: Foldable t => t (Double, Double) -> PointStyleF f -> SeriesF f Source #
Construct a series from any foldable container of x-y tuples.
Note that this is polymorphic over both PointStyle and
AutoPointStyle:
tupleSeries:: Foldable t => t (Double, Double) ->PointStyle->SeriesFtupleSeries:: Foldable t => t (Double, Double) ->AutoPointStyle->AutoSeries
funcSeries :: Foldable t => (Double -> Double) -> t Double -> PointStyleF f -> SeriesF f Source #
Construct a series from a function x to y, given a foldable container of x values.
Note that this is polymorphic over both PointStyle and
AutoPointStyle:
funcSeries:: Foldable t => (Double -> Double) -> t Double ->PointStyle->SeriesFfuncSeries:: Foldable t => (Double -> Double) -> t Double ->AutoPointStyle->AutoSeries
Arguments
| :: Fractional a | |
| => Int | Number of points |
| -> Range a | Range to generate the points over |
| -> [a] |
Create a SeriesF from an AutoSeries.
fromAutoSeries :: [AutoSeries] -> [Series] Source #
Turn an AutoSeries into a SeriesF, assigning styles from
a pre-specified "shuffled" order.
fromAutoSeriesIO :: [AutoSeries] -> IO [Series] Source #
Turn an AutoSeries into a SeriesF, drawing styles randomly in IO.
fromAutoSeries_ :: StdGen -> [AutoSeries] -> [Series] Source #
Turn an AutoSeries into a SeriesF, shuffling the default styles in
a deterministic way from a given seed.
defaultStyles :: Set PointStyle Source #
A set of default point styles