Graphics.Rendering.Chart.Axis.Floating

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

Copyright | (c) Tim Docker 2010 2014
License | BSD-style (see chart/COPYRIGHT)
Safe Haskell | None
Language | Haskell98

Graphics.Rendering.Chart.Axis.Floating

Contents

- Orphan instances

Description

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

Synopsis

- newtype Percent = Percent {
  - unPercent :: Double
  }
- data LinearAxisParams a = LinearAxisParams {
  - _la_labelf :: [a] -> [String]
  - _la_nLabels :: Int
  - _la_nTicks :: Int
  }
- newtype LogValue = LogValue {
  - unLogValue :: Double
  }
- data LogAxisParams a = LogAxisParams {
  - _loga_labelf :: [a] -> [String]
  }
- scaledAxis :: RealFloat a => LinearAxisParams a -> (a, a) -> AxisFn a
- autoScaledAxis :: RealFloat a => LinearAxisParams a -> AxisFn a
- autoScaledLogAxis :: RealFloat a => LogAxisParams a -> AxisFn a
- autoSteps :: Int -> [Double] -> [Double]
- la_labelf :: forall a1 a2 f. Functor f => (([a1] -> [String]) -> f ([a2] -> [String])) -> LinearAxisParams a1 -> f (LinearAxisParams a2)
- la_nLabels :: forall a f. Functor f => (Int -> f Int) -> LinearAxisParams a -> f (LinearAxisParams a)
- la_nTicks :: forall a f. Functor f => (Int -> f Int) -> LinearAxisParams a -> f (LinearAxisParams a)
- loga_labelf :: forall a1 a2 p f. (Profunctor p, Functor f) => p ([a1] -> [String]) (f ([a2] -> [String])) -> p (LogAxisParams a1) (f (LogAxisParams a2))

# 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

#### Instances

Instances details

PlotValue Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toValue :: Percent -> Double # fromValue :: Double -> Percent # autoAxis :: AxisFn Percent #
Floating Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods pi :: Percent # exp :: Percent -> Percent # log :: Percent -> Percent # sqrt :: Percent -> Percent # (**) :: Percent -> Percent -> Percent # logBase :: Percent -> Percent -> Percent # sin :: Percent -> Percent # cos :: Percent -> Percent # tan :: Percent -> Percent # asin :: Percent -> Percent # acos :: Percent -> Percent # atan :: Percent -> Percent # sinh :: Percent -> Percent # cosh :: Percent -> Percent # tanh :: Percent -> Percent # asinh :: Percent -> Percent # acosh :: Percent -> Percent # atanh :: Percent -> Percent # log1p :: Percent -> Percent # expm1 :: Percent -> Percent # log1pexp :: Percent -> Percent # log1mexp :: Percent -> Percent #
RealFloat Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods floatRadix :: Percent -> Integer # floatDigits :: Percent -> Int # floatRange :: Percent -> (Int, Int) # decodeFloat :: Percent -> (Integer, Int) # encodeFloat :: Integer -> Int -> Percent # exponent :: Percent -> Int # significand :: Percent -> Percent # scaleFloat :: Int -> Percent -> Percent # isNaN :: Percent -> Bool # isInfinite :: Percent -> Bool # isDenormalized :: Percent -> Bool # isNegativeZero :: Percent -> Bool # isIEEE :: Percent -> Bool # atan2 :: Percent -> Percent -> Percent #
Num Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (+) :: Percent -> Percent -> Percent # (-) :: Percent -> Percent -> Percent # (*) :: Percent -> Percent -> Percent # negate :: Percent -> Percent # abs :: Percent -> Percent # signum :: Percent -> Percent # fromInteger :: Integer -> Percent #
Fractional Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (/) :: Percent -> Percent -> Percent # recip :: Percent -> Percent # fromRational :: Rational -> Percent #
Real Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toRational :: Percent -> Rational #
RealFrac Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods properFraction :: Integral b => Percent -> (b, Percent) # truncate :: Integral b => Percent -> b # round :: Integral b => Percent -> b # ceiling :: Integral b => Percent -> b # floor :: Integral b => Percent -> b #
Show Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods showsPrec :: Int -> Percent -> ShowS # show :: Percent -> String # showList :: [Percent] -> ShowS #
Eq Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (==) :: Percent -> Percent -> Bool # (/=) :: Percent -> Percent -> Bool #
Ord Percent # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods compare :: Percent -> Percent -> Ordering # (<) :: Percent -> Percent -> Bool # (<=) :: Percent -> Percent -> Bool # (>) :: Percent -> Percent -> Bool # (>=) :: Percent -> Percent -> Bool # max :: Percent -> Percent -> Percent # min :: Percent -> Percent -> Percent #

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

Instances details

(Show a, RealFloat a) => Default (LinearAxisParams a) # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods def :: LinearAxisParams a #

newtype LogValue #

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

Constructors

LogValue |
Fields unLogValue :: Double

#### Instances

Instances details

PlotValue LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toValue :: LogValue -> Double # fromValue :: Double -> LogValue # autoAxis :: AxisFn LogValue #
BarsPlotValue LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Plot.Bars Methods barsIsNull :: LogValue -> Bool # barsReference :: [LogValue] -> LogValue # barsAdd :: LogValue -> LogValue -> LogValue #
Floating LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods pi :: LogValue # exp :: LogValue -> LogValue # log :: LogValue -> LogValue # sqrt :: LogValue -> LogValue # (**) :: LogValue -> LogValue -> LogValue # logBase :: LogValue -> LogValue -> LogValue # sin :: LogValue -> LogValue # cos :: LogValue -> LogValue # tan :: LogValue -> LogValue # asin :: LogValue -> LogValue # acos :: LogValue -> LogValue # atan :: LogValue -> LogValue # sinh :: LogValue -> LogValue # cosh :: LogValue -> LogValue # tanh :: LogValue -> LogValue # asinh :: LogValue -> LogValue # acosh :: LogValue -> LogValue # atanh :: LogValue -> LogValue # log1p :: LogValue -> LogValue # expm1 :: LogValue -> LogValue # log1pexp :: LogValue -> LogValue # log1mexp :: LogValue -> LogValue #
RealFloat LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods floatRadix :: LogValue -> Integer # floatDigits :: LogValue -> Int # floatRange :: LogValue -> (Int, Int) # decodeFloat :: LogValue -> (Integer, Int) # encodeFloat :: Integer -> Int -> LogValue # exponent :: LogValue -> Int # significand :: LogValue -> LogValue # scaleFloat :: Int -> LogValue -> LogValue # isNaN :: LogValue -> Bool # isInfinite :: LogValue -> Bool # isDenormalized :: LogValue -> Bool # isNegativeZero :: LogValue -> Bool # isIEEE :: LogValue -> Bool # atan2 :: LogValue -> LogValue -> LogValue #
Num LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (+) :: LogValue -> LogValue -> LogValue # (-) :: LogValue -> LogValue -> LogValue # (*) :: LogValue -> LogValue -> LogValue # negate :: LogValue -> LogValue # abs :: LogValue -> LogValue # signum :: LogValue -> LogValue # fromInteger :: Integer -> LogValue #
Fractional LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (/) :: LogValue -> LogValue -> LogValue # recip :: LogValue -> LogValue # fromRational :: Rational -> LogValue #
Real LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods toRational :: LogValue -> Rational #
RealFrac LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods properFraction :: Integral b => LogValue -> (b, LogValue) # truncate :: Integral b => LogValue -> b # round :: Integral b => LogValue -> b # ceiling :: Integral b => LogValue -> b # floor :: Integral b => LogValue -> b #
Show LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods showsPrec :: Int -> LogValue -> ShowS # show :: LogValue -> String # showList :: [LogValue] -> ShowS #
Eq LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods (==) :: LogValue -> LogValue -> Bool # (/=) :: LogValue -> LogValue -> Bool #
Ord LogValue # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods compare :: LogValue -> LogValue -> Ordering # (<) :: LogValue -> LogValue -> Bool # (<=) :: LogValue -> LogValue -> Bool # (>) :: LogValue -> LogValue -> Bool # (>=) :: LogValue -> LogValue -> Bool # max :: LogValue -> LogValue -> LogValue # min :: LogValue -> LogValue -> LogValue #

data LogAxisParams a #

Constructors

LogAxisParams |
Fields _loga_labelf :: [a] -> [String] The function used to show the axes labels.

#### Instances

Instances details

(Show a, RealFloat a) => Default (LogAxisParams a) # |
Instance details Defined in Graphics.Rendering.Chart.Axis.Floating Methods def :: LogAxisParams a #

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 appropriately 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 a1 a2 f. Functor f => (([a1] -> [String]) -> f ([a2] -> [String])) -> LinearAxisParams a1 -> f (LinearAxisParams a2) #

la_nLabels :: forall a f. Functor f => (Int -> f Int) -> LinearAxisParams a -> f (LinearAxisParams a) #

la_nTicks :: forall a f. Functor f => (Int -> f Int) -> LinearAxisParams a -> f (LinearAxisParams a) #

loga_labelf :: forall a1 a2 p f. (Profunctor p, Functor f) => p ([a1] -> [String]) (f ([a2] -> [String])) -> p (LogAxisParams a1) (f (LogAxisParams a2)) #

# Orphan instances

PlotValue Double # |
Instance details Methods toValue :: Double -> Double # fromValue :: Double -> Double # autoAxis :: AxisFn Double #
PlotValue Float # |
Instance details Methods toValue :: Float -> Double # fromValue :: Double -> Float # autoAxis :: AxisFn Float #