| Copyright | (C) 2016 Christopher Chalmers |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Christopher Chalmers |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- data ColourBar
- class HasColourBar a where
- colourBar :: Lens' a ColourBar
- colourBarDraw :: Lens' a (ColourMap -> Diagram V2)
- colourBarWidth :: Lens' a Double
- colourBarLengthFunction :: Lens' a (Double -> Double)
- colourBarGap :: Lens' a Double
- colourBarStyle :: Lens' a (Style V2 Double)
- defColourBar :: ColourBar
- gradientColourBar :: ColourMap -> Diagram V2
- pathColourBar :: Int -> ColourMap -> Diagram V2
- renderColourBar :: ColourBar -> ColourMap -> (Double, Double) -> Double -> Diagram V2
- addColourBar :: BoundingBox V2 Double -> ColourBar -> ColourMap -> (Double, Double) -> Diagram V2
The colour bar
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
class HasColourBar a where Source #
Minimal complete definition
Methods
colourBar :: Lens' a ColourBar Source #
Lens onto the ColourBar.
colourBarDraw :: Lens' a (ColourMap -> Diagram V2) 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 Double Source #
The width (orthogonal to the colour bar direction) of the colour bar.
Default is 20.
colourBarLengthFunction :: Lens' a (Double -> Double) Source #
Set the length of the colour bar given the length of the axis the colour bar is aligned to.
colourBarGap :: Lens' a Double Source #
Gap between the axis and the colour bar (if rendered with an axis).
Default is 20.
colourBarStyle :: Lens' a (Style V2 Double) Source #
Style used for the outline of a colour bar.
Instances
| HasColourBar ColourBar Source # | |
Defined in Plots.Axis.ColourBar Methods colourBar :: Lens' ColourBar ColourBar Source # colourBarDraw :: Lens' ColourBar (ColourMap -> Diagram V2) Source # colourBarWidth :: Lens' ColourBar Double Source # colourBarLengthFunction :: Lens' ColourBar (Double -> Double) Source # colourBarGap :: Lens' ColourBar Double Source # colourBarStyle :: Lens' ColourBar (Style V2 Double) Source # | |
| HasColourBar (Axis v) Source # | |
Defined in Plots.Axis | |
defColourBar :: ColourBar Source #
The default colour bar.
Rendering options
gradientColourBar :: ColourMap -> Diagram V2 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 :: Int -> ColourMap -> Diagram V2 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
Arguments
| :: ColourBar | options for colour bar |
| -> ColourMap | map to use |
| -> (Double, Double) | bounds of the values on the colour bar |
| -> Double | length of the colour bar |
| -> Diagram V2 |
Render a colour bar by it's self at a given width. Note this
ignores colourBarGap and colourBarLengthFunction.