Chart-0.16: A library for generating 2D Charts and Plots

Safe Haskell | None

Graphics.Rendering.Chart.Simple.Internal

Synopsis

- styleColor :: Int -> AlphaColour Double
- styleSymbol :: Int -> PlotKind
- iplot :: [InternalPlot Double Double] -> Layout1 Double Double
- name :: [PlotKind] -> String
- str2k :: String -> [PlotKind]
- str2khelper :: String -> PlotKind -> [PlotKind]
- data PlotKind
  - = Name String
  - | FilledCircle
  - | HollowCircle
  - | Triangle
  - | DownTriangle
  - | Square
  - | Diamond
  - | Plus
  - | Ex
  - | Star
  - | Symbols
  - | LittleDot
  - | Dashed
  - | Dotted
  - | Solid
- data InternalPlot x y
  - = IPY [y] [PlotKind]
  - | IPX [x] [PlotKind]
- newtype Layout1DDD = Layout1DDD {
  - plotLayout :: Layout1 Double Double
  }
- uplot :: [UPlot] -> Layout1DDD
- plot :: PlotType a => a
- class PlotType t where
  - pl :: [UPlot] -> t
- plotPDF :: PlotPDFType a => String -> a
- class PlotPDFType t where
  - pld :: FilePath -> [UPlot] -> t
- plotPS :: PlotPSType a => String -> a
- class PlotPSType t where
  - pls :: FilePath -> [UPlot] -> t
- plotPNG :: PlotPNGType a => String -> a
- class PlotPNGType t where
  - plp :: FilePath -> [UPlot] -> t
- data UPlot
  - = UString String
  - | UDoubles [Double]
  - | UFunction (Double -> Double)
  - | UKind [PlotKind]
  - | X [Double]
- xcoords :: [Double] -> UPlot
- class PlotArg a where
  - toUPlot :: a -> [UPlot]
- class IsPlot c where
  - toUPlot' :: [c] -> [UPlot]

# Documentation

styleColor :: Int -> AlphaColour Double Source

styleSymbol :: Int -> PlotKind Source

iplot :: [InternalPlot Double Double] -> Layout1 Double Double Source

name :: [PlotKind] -> String Source

str2k :: String -> [PlotKind]Source

str2khelper :: String -> PlotKind -> [PlotKind]Source

data PlotKind Source

Type to define a few simple properties of each plot.

Constructors

Name String |
FilledCircle |
HollowCircle |
Triangle |
DownTriangle |
Square |
Diamond |
Plus |
Ex |
Star |
Symbols |
LittleDot |
Dashed |
Dotted |
Solid |

Instances

Eq PlotKind |
Ord PlotKind |
Show PlotKind |
IsPlot PlotKind |
PlotArg PlotKind |

data InternalPlot x y Source

Constructors

IPY [y] [PlotKind] |
IPX [x] [PlotKind] |

newtype Layout1DDD Source

Constructors

Layout1DDD |

Fields

plotLayout :: Layout1 Double Double

Instances

ToRenderable Layout1DDD |
PlotType Layout1DDD |

uplot :: [UPlot] -> Layout1DDD Source

plot :: PlotType a => aSource

The main plotting function. The idea behind PlotType is shamelessly copied from Text.Printf (and is not exported). All you need to know is that your arguments need to be in class PlotArg. And PlotArg consists of functions and [Double] and String and PlotKind or [PlotKind].

class PlotType t where Source

Methods

pl :: [UPlot] -> tSource

Instances

PlotType Layout1DDD |
(PlotArg a, PlotType r) => PlotType (a -> r) |

plotPDF :: PlotPDFType a => String -> aSource

Save a plot as a PDF file.

class PlotPDFType t where Source

Methods

pld :: FilePath -> [UPlot] -> tSource

Instances

PlotPDFType (IO a) |
(PlotArg a, PlotPDFType r) => PlotPDFType (a -> r) |

plotPS :: PlotPSType a => String -> aSource

Save a plot as a postscript file.

class PlotPSType t where Source

Methods

pls :: FilePath -> [UPlot] -> tSource

Instances

PlotPSType (IO a) |
(PlotArg a, PlotPSType r) => PlotPSType (a -> r) |

plotPNG :: PlotPNGType a => String -> aSource

Save a plot as a png file.

class PlotPNGType t where Source

Methods

plp :: FilePath -> [UPlot] -> tSource

Instances

PlotPNGType (IO a) |
(PlotArg a, PlotPNGType r) => PlotPNGType (a -> r) |

data UPlot Source

Constructors

UString String |
UDoubles [Double] |
UFunction (Double -> Double) |
UKind [PlotKind] |
X [Double] |

Instances

PlotArg UPlot |

xcoords :: [Double] -> UPlot Source

class PlotArg a where Source

Methods

toUPlot :: a -> [UPlot]Source

Instances

PlotArg UPlot |
PlotArg PlotKind |
IsPlot p => PlotArg [p] |
(Real a, Real b, Fractional a, Fractional b) => PlotArg (a -> b) |

class IsPlot c where Source

Methods

toUPlot' :: [c] -> [UPlot]Source

Instances

IsPlot Char |
IsPlot Double |
IsPlot PlotKind |
IsPlot p => IsPlot [p] |
(Real a, Real b, Fractional a, Fractional b) => IsPlot (a -> b) |
(IsPlot p, IsPlot q) => IsPlot (p, q) |
(IsPlot p, IsPlot q, IsPlot r) => IsPlot (p, q, r) |