plots-0.1.1.4: Diagrams based plotting library
Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plots.Axis.Grid

Description

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

Synopsis

Grid lines

data GridLines v n Source #

Type holding information about both major and minor grid lines.

Instances

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

Defined in Plots.Axis.Grid

Methods

gridLines :: LensLike' f (GridLines v n) (GridLines (V (GridLines v n)) (N (GridLines v n))) Source #

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

Defined in Plots.Axis.Grid

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

Defined in Plots.Axis.Grid

(Typeable n, Floating n) => Default (GridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: GridLines v n #

Typeable n => HasStyle (GridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

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

type N (GridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

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

Defined in Plots.Axis.Grid

type V (GridLines v n) = v

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

Methods

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

Instances

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

Defined in Plots.Axis.Grid

Methods

gridLines :: LensLike' f (GridLines v n) (GridLines (V (GridLines v n)) (N (GridLines v n))) Source #

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

Defined in Plots.Axis

Methods

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

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

Defined in Plots.Axis

Methods

gridLines :: LensLike' f (SingleAxis b v n) (GridLines (V (SingleAxis b v n)) (N (SingleAxis b v n))) Source #

data MajorGridLines v n Source #

Instances

Instances details
HasMajorGridLines f (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

(Typeable n, Floating n) => Default (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: MajorGridLines v n #

Typeable n => HasStyle (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

HasVisibility (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

type N (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

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

Defined in Plots.Axis.Grid

type V (MajorGridLines v n) = v

class HasMajorGridLines f a where Source #

Minimal complete definition

majorGridLines

Methods

majorGridLines :: LensLike' f a (MajorGridLines (V a) (N 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 (N a)) 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) (N a)) Source #

The style applied to the major grid lines.

Instances

Instances details
Functor f => HasMajorGridLines f (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

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

Defined in Plots.Axis.Grid

HasMajorGridLines f (MajorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

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

Defined in Plots.Axis

Methods

majorGridLines :: LensLike' f (Axis b c n) (MajorGridLines (V (Axis b c n)) (N (Axis b c n))) Source #

majorGridLinesFunction :: LensLike' f (Axis b c n) (GridLineFunction (N (Axis b c n))) Source #

majorGridLinesStyle :: LensLike' f (Axis b c n) (Style (V (Axis b c n)) (N (Axis b c n))) Source #

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

Defined in Plots.Axis

data MinorGridLines v n Source #

Instances

Instances details
HasMinorGridLines f (MinorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

(Typeable n, Floating n) => Default (MinorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

Methods

def :: MinorGridLines v n #

Typeable n => HasStyle (MinorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

HasVisibility (MinorGridLines v n) Source #

Hidden by default.

Instance details

Defined in Plots.Axis.Grid

type N (MinorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

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

Defined in Plots.Axis.Grid

type V (MinorGridLines v n) = v

class HasMinorGridLines f a where Source #

Minimal complete definition

minorGridLines

Methods

minorGridLines :: LensLike' f a (MinorGridLines (V a) (N 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 (N a)) 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) (N a)) Source #

The style applied to the minor grid lines.

Instances

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

Defined in Plots.Axis.Grid

HasMinorGridLines f (MinorGridLines v n) Source # 
Instance details

Defined in Plots.Axis.Grid

(Applicative f, Traversable c) => HasMinorGridLines f (Axis b c n) Source # 
Instance details

Defined in Plots.Axis

Methods

minorGridLines :: LensLike' f (Axis b c n) (MinorGridLines (V (Axis b c n)) (N (Axis b c n))) Source #

minorGridLinesFunction :: LensLike' f (Axis b c n) (GridLineFunction (N (Axis b c n))) Source #

minorGridLinesStyle :: LensLike' f (Axis b c n) (Style (V (Axis b c n)) (N (Axis b c n))) Source #

Functor f => HasMinorGridLines f (SingleAxis b v n) Source # 
Instance details

Defined in Plots.Axis

Extra traversals

gridLinesStyle :: (HasGridLines f a, Applicative f) => LensLike' f a (Style (V a) (N a)) 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.