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

Safe Haskell | None

Graphics.Rendering.Chart.Simple

Description

An even simpler framework for creating 2D charts in Haskell.

The basic idea is to make it as easy to plot as octave, which means that you provide no more information than you wish to provide. We provide four plotting functions, which differ only in their output. One produces a Layout1 that you can customize using other Graphics.Rendering.Chart functions. The other three produce their output directly. All three accept the same input and produce the same plots.

The plot functions accept a variable number of arguments. You must provide a [Double] which defines the points on the x axis, which must precede any of the y values. The y values may either be [Double] or functions. After any given y value, you can give either Strings or PlotKinds describing how you'd like that y printed.

Examples:

     plotPDF "foo.pdf" [0,0.1..10] sin "- " cos ". " cos "o"

     plotPS "foo.ps" [0,0.1..10] (sin . exp) "- " (sin . exp) "o-"

Synopsis

- plot :: PlotType a => a
- data PlotKind
  - = Name String
  - | FilledCircle
  - | HollowCircle
  - | Triangle
  - | DownTriangle
  - | Square
  - | Diamond
  - | Plus
  - | Ex
  - | Star
  - | Symbols
  - | LittleDot
  - | Dashed
  - | Dotted
  - | Solid
- xcoords :: [Double] -> UPlot
- plotPDF :: PlotPDFType a => String -> a
- plotPS :: PlotPSType a => String -> a
- plotLayout :: Layout1DDD -> Layout1 Double Double
- plotPNG :: PlotPNGType a => String -> a
- data Layout1DDD

# Documentation

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].

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 |

xcoords :: [Double] -> UPlot Source

plotPDF :: PlotPDFType a => String -> aSource

Save a plot as a PDF file.

plotPS :: PlotPSType a => String -> aSource

Save a plot as a postscript file.

plotLayout :: Layout1DDD -> Layout1 Double Double Source

plotPNG :: PlotPNGType a => String -> aSource

Save a plot as a png file.

data Layout1DDD Source

Instances

ToRenderable Layout1DDD |
PlotType Layout1DDD |