plots-0.1.0.2: Diagrams based plotting library.

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

Plots.Axis.ColourBar

Contents

Description

Options for rendering a colour bar, either attached to an axis or rendered separately.

To change the colour map used for the colour bar see axisColourMap from Plots.Style.

Synopsis

The colour bar

data ColourBar b n Source #

Options for drawing a colour bar. Note that for an axis, the ColourMap is stored in the AxisStyle. These options are for other aspects of the bar, not the colours used.

Instances

Functor f => HasMajorTicks f (ColourBar b n) Source # 
Functor f => HasTickLabels f (ColourBar b n) b Source # 
Typeable * n => HasStyle (ColourBar b n) Source # 

Methods

applyStyle :: Style (V (ColourBar b n)) (N (ColourBar b n)) -> ColourBar b n -> ColourBar b n #

HasPlacement (ColourBar b n) Source # 
HasGap (ColourBar b n) Source # 

Methods

gap :: Lens' (ColourBar b n) (N (ColourBar b n)) Source #

HasOrientation (ColourBar b n) Source # 
HasVisibility (ColourBar b n) Source # 
HasColourBar (ColourBar b n) b Source # 
type V (ColourBar b n) Source # 
type V (ColourBar b n) = V2
type N (ColourBar b n) Source # 
type N (ColourBar b n) = n

class HasColourBar a b | a -> b where Source #

Minimal complete definition

colourBar

Methods

colourBar :: Lens' a (ColourBar b (N a)) Source #

Lens onto the ColourBar.

colourBarDraw :: Lens' a (ColourMap -> QDiagram b V2 (N a) Any) Source #

How to draw the colour bar. Expects a 1 by 1 box with the gradient going from left to right, without an outline with origin in the middle of the left side. See gradientColourBar and pathColourBar.

The colour map this function recieves it given by axisColourMap from Plots.Style

Default is gradientColourBar.

colourBarWidth :: Lens' a (N a) Source #

The width (orthogonal to the colour bar direction) of the colour bar.

Default is 20.

colourBarLengthFunction :: Lens' a (N a -> N a) Source #

Set the length of the colour bar given the length of the axis the colour bar is aligned to.

Default is id.

colourBarGap :: Lens' a (N a) Source #

Gap between the axis and the colour bar (if rendered with an axis).

Default is 20.

colourBarStyle :: Lens' a (Style V2 (N a)) Source #

Style used for the outline of a colour bar.

Instances

defColourBar :: (Renderable (Text n) b, Renderable (Path V2 n) b, TypeableFloat n) => ColourBar b n Source #

The default colour bar.

Rendering options

gradientColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => ColourMap -> QDiagram b V2 n Any Source #

The colour bar generated by a gradient texture. The final diagram is 1 by 1, with origin at the middle of the left side. This can be used as the colourBarDraw function.

This may not be supported by all backends.

pathColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => Int -> ColourMap -> QDiagram b V2 n Any Source #

Construct a colour bar made up of n solid square paths. The final diagram is 1 by 1, with origin at the middle of the left side. This can be used as the colourBarDraw function.

Rendering colour bars

renderColourBar Source #

Arguments

:: (TypeableFloat n, Renderable (Path V2 n) b) 
=> ColourBar b n

options for colour bar

-> ColourMap

map to use

-> (n, n)

bounds of the values on the colour bar

-> n

length of the colour bar

-> QDiagram b V2 n Any 

Render a colour bar by it's self at a given width. Note this ignores colourBarGap and colourBarLengthFunction.

addColourBar Source #

Arguments

:: (TypeableFloat n, Renderable (Path V2 n) b) 
=> BoundingBox V2 n

bounding box to place against

-> ColourBar b n 
-> ColourMap 
-> (n, n) 
-> QDiagram b V2 n Any 

Add a colour bar to an object, using the bounding box for the object.