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

Plots.Axis.ColourBar

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

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

Defined in Plots.Axis.ColourBar

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

Defined in Plots.Axis.ColourBar

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

Defined in Plots.Axis.ColourBar

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

Defined in Plots.Axis.ColourBar

Typeable n => HasStyle (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

Methods

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

HasGap (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

Methods

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

HasOrientation (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

HasPlacement (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

HasVisibility (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

HasColourBar (ColourBar b n) b Source # 
Instance details

Defined in Plots.Axis.ColourBar

type N (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

type N (ColourBar b n) = n
type V (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

type V (ColourBar b n) = V2

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

Instances details
HasColourBar (ColourBar b n) b Source # 
Instance details

Defined in Plots.Axis.ColourBar

HasColourBar (Axis b v n) b Source # 
Instance details

Defined in Plots.Axis

Methods

colourBar :: Lens' (Axis b v n) (ColourBar b (N (Axis b v n))) Source #

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

colourBarWidth :: Lens' (Axis b v n) (N (Axis b v n)) Source #

colourBarLengthFunction :: Lens' (Axis b v n) (N (Axis b v n) -> N (Axis b v n)) Source #

colourBarGap :: Lens' (Axis b v n) (N (Axis b v n)) Source #

colourBarStyle :: Lens' (Axis b v n) (Style V2 (N (Axis b v n))) Source #

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.