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

Copyright(c) Tim Docker 2010, 2014
LicenseBSD-style (see chart/COPYRIGHT)
Safe HaskellNone
LanguageHaskell98

Graphics.Rendering.Chart.Axis.Floating

Description

Calculate and render floating value axes including doubles with linear, log, and percentage scaling.

Synopsis

Documentation

newtype Percent

A wrapper class for doubles used to indicate they are to be plotted against a percentage axis.

Constructors

Percent 

Fields

unPercent :: Double
 

data LinearAxisParams a

Constructors

LinearAxisParams 

Fields

_la_labelf :: a -> String

The function used to show the axes labels.

_la_nLabels :: Int

The target number of labels to be shown.

_la_nTicks :: Int

The target number of ticks to be shown.

Instances

newtype LogValue

A wrapper class for doubles used to indicate they are to be plotted against a log axis.

Constructors

LogValue Double 

data LogAxisParams a

Constructors

LogAxisParams 

Fields

_loga_labelf :: a -> String

The function used to show the axes labels.

Instances

scaledAxis :: RealFloat a => LinearAxisParams a -> (a, a) -> AxisFn a

Generate a linear axis with the specified bounds

autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn a

Generate a linear axis automatically, scaled appropriately for the input data.

autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn a

Generate a log axis automatically, scaled appropriate for the input data.

autoSteps :: Int -> [Double] -> [Double]

Given a target number of values, and a list of input points, find evenly spaced values from the set {1*X, 2*X, 2.5*X, 5*X} (where X is some power of ten) that evenly cover the input points.

la_labelf :: forall a a. Lens (LinearAxisParams a) (LinearAxisParams a) (a -> String) (a -> String)

loga_labelf :: forall a a. Iso (LogAxisParams a) (LogAxisParams a) (a -> String) (a -> String)