plots-0.1.1.1: Diagrams based plotting library.

Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Plots.Axis.Grid

Contents

Description

Lines that go along the axis. Supports major and minor grid lines separately for each axis.

Synopsis

Grid lines

data GridLines v Source #

Type holding information about both major and minor grid lines.

Instances
Functor f => HasGridLines f (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Functor f => HasMinorGridLines f (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Functor f => HasMajorGridLines f (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Default (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: GridLines v #

ApplyStyle (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

applyStyle :: Style (V (GridLines v)) (N (GridLines v)) -> GridLines v -> GridLines v

type N (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type N (GridLines v) = Double
type V (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type V (GridLines v) = v

class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where Source #

Methods

gridLines :: LensLike' f a (GridLines (V a)) Source #

Instances
Functor f => HasGridLines f (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

(Applicative f, Traversable c) => HasGridLines f (Axis c) Source # 
Instance details

Defined in Plots.Axis

Methods

gridLines :: LensLike' f (Axis c) (GridLines (V (Axis c))) Source #

Functor f => HasGridLines f (SingleAxis v) Source # 
Instance details

Defined in Plots.Axis

data MajorGridLines v Source #

Instances
HasMajorGridLines f (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Default (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: MajorGridLines v #

ApplyStyle (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

applyStyle :: Style (V (MajorGridLines v)) (N (MajorGridLines v)) -> MajorGridLines v -> MajorGridLines v

HasStyle (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

style :: Lens' (MajorGridLines v) (Style (V (MajorGridLines v)) (N (MajorGridLines v)))

HasVisibility (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type N (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type N (MajorGridLines v) = Double
type V (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type V (MajorGridLines v) = v

class HasMajorGridLines f a where Source #

Minimal complete definition

majorGridLines

Methods

majorGridLines :: LensLike' f a (MajorGridLines (V a)) Source #

The options for how to draw the grid lines. This can be used on various levels of the axis:

majorGridLines :: Traversal' (Axis b c n)       (GridLines (BaseSpace c) n)
majorGridLines :: Lens'      (SingleAxis b v n) (GridLines v n)
majorGridLines :: Lens'      (GridLines v n)    (GridLines v n)

majorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction Double) Source #

The function to calculate location of the major grid lines given location of the major ticks and bounds.

majorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) Double) Source #

The style applied to the major grid lines.

Instances
Functor f => HasMajorGridLines f ColourBar Source # 
Instance details

Defined in Plots.Axis.ColourBar

Functor f => HasMajorGridLines f (GridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

HasMajorGridLines f (MajorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

(Applicative f, Traversable c) => HasMajorGridLines f (Axis c) Source # 
Instance details

Defined in Plots.Axis

Functor f => HasMajorGridLines f (SingleAxis v) Source # 
Instance details

Defined in Plots.Axis

data MinorGridLines v Source #

Instances
HasMinorGridLines f (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Default (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: MinorGridLines v #

ApplyStyle (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

applyStyle :: Style (V (MinorGridLines v)) (N (MinorGridLines v)) -> MinorGridLines v -> MinorGridLines v

HasStyle (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

style :: Lens' (MinorGridLines v) (Style (V (MinorGridLines v)) (N (MinorGridLines v)))

HasVisibility (MinorGridLines v) Source #

Hidden by default.

Instance details

Defined in Plots.Axis.Grid

type N (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type N (MinorGridLines v) = Double
type V (MinorGridLines v) Source # 
Instance details

Defined in Plots.Axis.Grid

type V (MinorGridLines v) = v

class HasMinorGridLines f a where Source #

Minimal complete definition

minorGridLines

Methods

minorGridLines :: LensLike' f a (MinorGridLines (V a)) Source #

The options for how to draw the grid lines. This can be used on various levels of the axis:

minorGridLines :: Traversal' (Axis b c n)       (GridLines (BaseSpace c) n)
minorGridLines :: Lens'      (SingleAxis b v n) (GridLines v n)
minorGridLines :: Lens'      (GridLines v n)    (GridLines v n)

minorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction Double) Source #

The function to calculate location of the minor grid lines given location of the minor ticks and bounds.

minorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) Double) Source #

The style applied to the minor grid lines.

Extra traversals

gridLinesStyle :: (HasGridLines f a, Applicative f) => LensLike' f a (Style (V a) Double) Source #

Traversal over both the major and minor grid styles. This can be used at several levels in the axis:

gridLinesVisible :: (HasGridLines f a, Applicative f) => LensLike' f a Bool Source #

Traversal over both the major and minor grid styles.

gridLinesVisible :: Traversal' (Axis b c n) Bool
gridLinesVisible :: Traversal' (SingleAxis b v n) Bool
gridLinesVisible :: Traversal' (GridLines v n) Bool

hideGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #

Hide both major and minor grid lines.

hideGridLines :: Axis b c n       -> Axis b c n
hideGridLines :: SingleAxis b c n -> SingleAxis b c n
hideGridLines :: GridLines b c n  -> GridLines b c n

showGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #

Show both major and minor grid lines.

showGridLines :: Axis b c n       -> Axis b c n
showGridLines :: SingleAxis b c n -> SingleAxis b c n
showGridLines :: GridLines b c n  -> GridLines b c n

Grid line functions

type GridLineFunction n = [n] -> (n, n) -> [n] Source #

A grid line function takes the positions of the respective ticks (minor ticks for minor grid lines, major ticks for major grid lines) and the bounds of the axis and returns the positions of the grid lines.

These functions are used in conjuction with majorGridLineFunction and minorGridLineFunction to control how the lines are drawn.

onTicksGridLineFunction :: GridLineFunction n Source #

Place grid lines at the same position as the respective ticks. This is the Default.

emptyGridLineFunction :: GridLineFunction n Source #

The GridLineFunction such that no grid lines appear.

See hideGridLines, majorGridLineVisible or minorGridLineVisible if you just want to hide the grid lines.