plots-0.1.1.3: 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.Types

Description

This module defines the various types for holding plots:

PlotOptions b v n
Generic options all plots have.
PlotMods b v n
Includes PlotOptions along with modifications to the PlotStyle.
Plot p b
A rawPlot p grouped with a PlotMods.
DynamicPlot b v n
A wrapped up Plot so it can be stored in an Axis.
StyledPlot b v n
A DynamicPlot with a concrete PlotStyle, ready to be rendered.

As well as other things like the Plotable class, LegendEntries, HasOrientation and HasVisibility.

Synopsis

Plot options

data PlotOptions b v n Source #

Data type for holding information all plots must contain.

Instances

Instances details
HasPlotOptions f (PlotOptions b v n) b Source # 
Instance details

Defined in Plots.Types

(Additive v, Num n) => Default (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

Methods

def :: PlotOptions b v n #

(Additive v, Num n) => HasOrigin (PlotOptions b v n) Source #

Move origin by applying to plotTransform.

Instance details

Defined in Plots.Types

Methods

moveOriginTo :: Point (V (PlotOptions b v n)) (N (PlotOptions b v n)) -> PlotOptions b v n -> PlotOptions b v n #

Qualifiable (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

Methods

(.>>) :: IsName a => a -> PlotOptions b v n -> PlotOptions b v n #

(HasLinearMap v, Num n) => Transformable (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

Methods

transform :: Transformation (V (PlotOptions b v n)) (N (PlotOptions b v n)) -> PlotOptions b v n -> PlotOptions b v n #

HasVisibility (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

type N (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (PlotOptions b v n) = v

class HasPlotOptions f a b | a -> b where Source #

Class of things that have PlotOptions.

Minimal complete definition

plotOptions

Methods

plotOptions :: LensLike' f a (PlotOptions b (V a) (N a)) Source #

Lens onto the PlotOptions.

plotName :: Functor f => LensLike' f a Name Source #

The Name applied to the plot. This gives a way to reference a specific plot in a rendered axis.

Default is mempty.

clipPlot :: Functor f => LensLike' f a Bool Source #

Whether the plot should be clipped to the bounds of the axes.

Default is True.

legendEntries :: Functor f => LensLike' f a [LegendEntry b (V a) (N a)] Source #

The legend entries to be used for the current plot.

Default is mempty.

plotTransform :: Functor f => LensLike' f a (Transformation (V a) (N a)) Source #

The transform applied to the plot once it's in the axis coordinates.

Default is mempty.

plotVisible :: Functor f => LensLike' f a Bool Source #

Whether or not the plot should be shown. The BoundingBox of the plot will still affect the inferred axis bounds.

Default is True.

Instances

Instances details
Functor f => HasPlotOptions f (Plot p b) b Source # 
Instance details

Defined in Plots.Types

Settable f => HasPlotOptions f (Axis b c n) b Source # 
Instance details

Defined in Plots.Axis

Methods

plotOptions :: LensLike' f (Axis b c n) (PlotOptions b (V (Axis b c n)) (N (Axis b c n))) Source #

plotName :: LensLike' f (Axis b c n) Name Source #

clipPlot :: LensLike' f (Axis b c n) Bool Source #

legendEntries :: LensLike' f (Axis b c n) [LegendEntry b (V (Axis b c n)) (N (Axis b c n))] Source #

plotTransform :: LensLike' f (Axis b c n) (Transformation (V (Axis b c n)) (N (Axis b c n))) Source #

plotVisible :: LensLike' f (Axis b c n) Bool Source #

Functor f => HasPlotOptions f (DynamicPlot b v n) b Source # 
Instance details

Defined in Plots.Types

Functor f => HasPlotOptions f (PlotMods b v n) b Source # 
Instance details

Defined in Plots.Types

HasPlotOptions f (PlotOptions b v n) b Source # 
Instance details

Defined in Plots.Types

Functor f => HasPlotOptions f (StyledPlot b v n) b Source # 
Instance details

Defined in Plots.Types

key :: (HasPlotOptions Identity a b, MonadState a m, Num (N a)) => String -> m () Source #

Add a LegendEntry to something with PlotOptions using the String as the legendText and a DefaultLegendPic. Here are some typical examples:

key :: String -> State (Plot (ScatterPlot v n) b) ()
key :: String -> State (DynamicPlot b v n) ()
key :: String -> State (PlotMods b v n) ()

If you only care about the name of the legend, use key.

addLegendEntry :: (HasPlotOptions Identity a b, MonadState a m) => LegendEntry b (V a) (N a) -> m () Source #

Add a LegendEntry to something with PlotOptions. Here are some typical examples:

addLegendEntry :: LegendEntry b v n -> State (Plot (ScatterPlot v n) b) ()
addLegendEntry :: LegendEntry b v n -> State (DynamicPlot b v n) ()

If you only care about the name of the legend, use key.

Plot modifications

data PlotMods b v n Source #

A PlotOptions with modifications to a PlotStyle.

Instances

Instances details
Settable f => HasPlotStyle f (PlotMods b v n) b Source # 
Instance details

Defined in Plots.Types

Methods

plotStyle :: LensLike' f (PlotMods b v n) (PlotStyle b (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotColour :: LensLike' f (PlotMods b v n) (Colour Double) Source #

plotColor :: LensLike' f (PlotMods b v n) (Colour Double) Source #

lineStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

lineStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

markerStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

markerStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

areaStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

areaStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

textStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

textStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotMarker :: LensLike' f (PlotMods b v n) (QDiagram b (V (PlotMods b v n)) (N (PlotMods b v n)) Any) Source #

plotStyles :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotStyleFunctions :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

Functor f => HasPlotOptions f (PlotMods b v n) b Source # 
Instance details

Defined in Plots.Types

(Additive v, Num n) => Default (PlotMods b v n) Source # 
Instance details

Defined in Plots.Types

Methods

def :: PlotMods b v n #

HasVisibility (PlotMods b v n) Source # 
Instance details

Defined in Plots.Types

type N (PlotMods b v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (PlotMods b v n) = v

plotMods :: Lens' (Plot p b) (PlotMods b (V p) (N p)) Source #

The modifications to the PlotOptions and PlotStyle in a Plot.

Plotable class

class (Typeable p, Enveloped p) => Plotable p b where Source #

Class defining how plots should be rendered.

Minimal complete definition

renderPlotable

Methods

renderPlotable :: InSpace v n p => AxisSpec v n -> PlotStyle b v n -> p -> QDiagram b v n Any Source #

Render a plot according to the AxisSpec, using the PlotStyle.

defLegendPic :: InSpace v n p => PlotStyle b v n -> p -> QDiagram b v n Any Source #

The default legend picture when the LegendPic is DefaultLegendPic.

Instances

Instances details
(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (BarPlot n) b Source # 
Instance details

Defined in Plots.Types.Bar

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (BarPlot n) => AxisSpec v n0 -> PlotStyle b v n0 -> BarPlot n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (BarPlot n) => PlotStyle b v n0 -> BarPlot n -> QDiagram b v n0 Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (HistogramPlot n) b Source # 
Instance details

Defined in Plots.Types.Histogram

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (HistogramPlot n) => AxisSpec v n0 -> PlotStyle b v n0 -> HistogramPlot n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (HistogramPlot n) => PlotStyle b v n0 -> HistogramPlot n -> QDiagram b v n0 Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (Wedge n) b Source # 
Instance details

Defined in Plots.Types.Pie

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (Wedge n) => AxisSpec v n0 -> PlotStyle b v n0 -> Wedge n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (Wedge n) => PlotStyle b v n0 -> Wedge n -> QDiagram b v n0 Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (Path V2 n) b Source # 
Instance details

Defined in Plots.Types

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (Path V2 n) => AxisSpec v n0 -> PlotStyle b v n0 -> Path V2 n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (Path V2 n) => PlotStyle b v n0 -> Path V2 n -> QDiagram b v n0 Any Source #

(Typeable b, TypeableFloat n, Renderable (Path V2 n) b) => Plotable (HeatMap b n) b Source # 
Instance details

Defined in Plots.Types.HeatMap

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (HeatMap b n) => AxisSpec v n0 -> PlotStyle b v n0 -> HeatMap b n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (HeatMap b n) => PlotStyle b v n0 -> HeatMap b n -> QDiagram b v n0 Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (ScatterPlot V2 n) b Source # 
Instance details

Defined in Plots.Types.Scatter

Methods

renderPlotable :: forall (v :: Type -> Type) n0. InSpace v n0 (ScatterPlot V2 n) => AxisSpec v n0 -> PlotStyle b v n0 -> ScatterPlot V2 n -> QDiagram b v n0 Any Source #

defLegendPic :: forall (v :: Type -> Type) n0. InSpace v n0 (ScatterPlot V2 n) => PlotStyle b v n0 -> ScatterPlot V2 n -> QDiagram b v n0 Any Source #

(Typeable b, Typeable v, Metric v, Typeable n, OrderedField n) => Plotable (QDiagram b v n Any) b Source # 
Instance details

Defined in Plots.Types

Methods

renderPlotable :: forall (v0 :: Type -> Type) n0. InSpace v0 n0 (QDiagram b v n Any) => AxisSpec v0 n0 -> PlotStyle b v0 n0 -> QDiagram b v n Any -> QDiagram b v0 n0 Any Source #

defLegendPic :: forall (v0 :: Type -> Type) n0. InSpace v0 n0 (QDiagram b v n Any) => PlotStyle b v0 n0 -> QDiagram b v n Any -> QDiagram b v0 n0 Any Source #

Plot types

Parameterised plot

data Plot p b Source #

A parameterised plot, together with a PlotMods. This type has an instance of many classes for modifying specific plots.

Instances

Instances details
(Functor f, HasWedge f a) => HasWedge f (Plot a b) Source # 
Instance details

Defined in Plots.Types.Pie

Methods

pieWedge :: LensLike' f (Plot a b) (Wedge (N (Plot a b))) Source #

wedgeOuterRadius :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeInnerRadius :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeOffset :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeWidth :: LensLike' f (Plot a b) (Angle (N (Plot a b))) Source #

wedgeDirection :: LensLike' f (Plot a b) (Direction V2 (N (Plot a b))) Source #

HasConnectingLine f p => HasConnectingLine f (Plot p b) Source # 
Instance details

Defined in Plots.Types.Scatter

Settable f => HasPlotStyle f (Plot p b) b Source # 
Instance details

Defined in Plots.Types

Methods

plotStyle :: LensLike' f (Plot p b) (PlotStyle b (V (Plot p b)) (N (Plot p b))) Source #

plotColour :: LensLike' f (Plot p b) (Colour Double) Source #

plotColor :: LensLike' f (Plot p b) (Colour Double) Source #

lineStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

lineStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

markerStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

markerStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

areaStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

areaStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

textStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

textStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

plotMarker :: LensLike' f (Plot p b) (QDiagram b (V (Plot p b)) (N (Plot p b)) Any) Source #

plotStyles :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

plotStyleFunctions :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

Functor f => HasPlotOptions f (Plot p b) b Source # 
Instance details

Defined in Plots.Types

(Functor f, HasHeatMap f a b) => HasHeatMap f (Plot a b) b Source # 
Instance details

Defined in Plots.Types.HeatMap

(Functor f, HasScatterOptions f p a) => HasScatterOptions f (Plot p b) a Source # 
Instance details

Defined in Plots.Types.Scatter

Methods

gscatterOptions :: LensLike' f (Plot p b) (ScatterOptions (V (Plot p b)) (N (Plot p b)) a) Source #

scatterTransform :: LensLike' f (Plot p b) (a -> Transformation (V (Plot p b)) (N (Plot p b))) Source #

scatterStyle :: LensLike' f (Plot p b) (a -> Style (V (Plot p b)) (N (Plot p b))) Source #

scatterPosition :: LensLike' f (Plot p b) (a -> Point (V (Plot p b)) (N (Plot p b))) Source #

HasOrientation p => HasOrientation (Plot p b) Source # 
Instance details

Defined in Plots.Types

HasVisibility (Plot p b) Source # 
Instance details

Defined in Plots.Types

HasBarLayout a => HasBarLayout (Plot a b) Source # 
Instance details

Defined in Plots.Types.Bar

Methods

barLayout :: Lens' (Plot a b) (BarLayout (N (Plot a b))) Source #

barWidth :: Lens' (Plot a b) (N (Plot a b)) Source #

barSpacing :: Lens' (Plot a b) (N (Plot a b)) Source #

barStart :: Lens' (Plot a b) (N (Plot a b)) Source #

HasHistogramOptions a => HasHistogramOptions (Plot a b) Source # 
Instance details

Defined in Plots.Types.Histogram

type N (Plot p b) Source # 
Instance details

Defined in Plots.Types

type N (Plot p b) = N p
type V (Plot p b) Source # 
Instance details

Defined in Plots.Types

type V (Plot p b) = V p

mkPlot :: (Additive (V p), Num (N p)) => p -> Plot p b Source #

Make a Plot with Default PlotOptions.

rawPlot :: SameSpace p p' => Lens (Plot p b) (Plot p' b) p p' Source #

Lens onto the raw Plotable inside a Plot.

Dynamic plot

data DynamicPlot b v n where Source #

A wrapped up Plot, used to store plots in an Axis.

Constructors

DynamicPlot :: (InSpace v n p, Plotable p b) => Plot p b -> DynamicPlot b v n 

Instances

Instances details
(Applicative f, Typeable b, v ~ V2, Typeable n) => HasWedge f (DynamicPlot b v n) Source # 
Instance details

Defined in Plots.Types.Pie

(Applicative f, Typeable b, Typeable v, Typeable n) => HasConnectingLine f (DynamicPlot b v n) Source # 
Instance details

Defined in Plots.Types.Scatter

Settable f => HasPlotStyle f (DynamicPlot b v n) b Source # 
Instance details

Defined in Plots.Types

Methods

plotStyle :: LensLike' f (DynamicPlot b v n) (PlotStyle b (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotColour :: LensLike' f (DynamicPlot b v n) (Colour Double) Source #

plotColor :: LensLike' f (DynamicPlot b v n) (Colour Double) Source #

lineStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

lineStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

markerStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

markerStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

areaStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

areaStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

textStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

textStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotMarker :: LensLike' f (DynamicPlot b v n) (QDiagram b (V (DynamicPlot b v n)) (N (DynamicPlot b v n)) Any) Source #

plotStyles :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotStyleFunctions :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

Functor f => HasPlotOptions f (DynamicPlot b v n) b Source # 
Instance details

Defined in Plots.Types

(Applicative f, Typeable b, Typeable v, Typeable n, Typeable a) => HasScatterOptions f (DynamicPlot b v n) a Source # 
Instance details

Defined in Plots.Types.Scatter

Methods

gscatterOptions :: LensLike' f (DynamicPlot b v n) (ScatterOptions (V (DynamicPlot b v n)) (N (DynamicPlot b v n)) a) Source #

scatterTransform :: LensLike' f (DynamicPlot b v n) (a -> Transformation (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

scatterStyle :: LensLike' f (DynamicPlot b v n) (a -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

scatterPosition :: LensLike' f (DynamicPlot b v n) (a -> Point (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

HasVisibility (DynamicPlot b v n) Source # 
Instance details

Defined in Plots.Types

type N (DynamicPlot b v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (DynamicPlot b v n) = v

_DynamicPlot :: (Plotable p b, Typeable b) => Prism' (DynamicPlot b (V p) (N p)) (Plot p b) Source #

Prism for a DynamicPlot.

dynamicPlot :: forall p b. (Typeable p, Typeable b) => Traversal' (DynamicPlot b (V p) (N p)) (Plot p b) Source #

Traversal over the dynamic plot without the Plotable constraint _DynamicPlot has.

dynamicPlotMods :: Lens' (DynamicPlot b v n) (PlotMods b v n) Source #

The modifications to the PlotOptions and PlotStyle in a DynamicPlot.

Styled plot

data StyledPlot b v n Source #

A DynamicPlot with a concrete style. This is suitable for being rendered with renderStyledPlot and get extract the legend entries with styledPlotLegend.

You can make a StyledPlot with styleDynamic

Instances

Instances details
(v ~ V2, Applicative f, Typeable n) => HasWedge f (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types.Pie

(Applicative f, Typeable v, Typeable n) => HasConnectingLine f (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types.Scatter

Functor f => HasPlotStyle f (StyledPlot b v n) b Source # 
Instance details

Defined in Plots.Types

Methods

plotStyle :: LensLike' f (StyledPlot b v n) (PlotStyle b (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotColour :: LensLike' f (StyledPlot b v n) (Colour Double) Source #

plotColor :: LensLike' f (StyledPlot b v n) (Colour Double) Source #

lineStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

lineStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

markerStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

markerStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

areaStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

areaStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

textStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

textStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotMarker :: LensLike' f (StyledPlot b v n) (QDiagram b (V (StyledPlot b v n)) (N (StyledPlot b v n)) Any) Source #

plotStyles :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotStyleFunctions :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

Functor f => HasPlotOptions f (StyledPlot b v n) b Source # 
Instance details

Defined in Plots.Types

(Metric v, OrderedField n) => Enveloped (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types

Methods

getEnvelope :: StyledPlot b v n -> Envelope (V (StyledPlot b v n)) (N (StyledPlot b v n)) #

HasVisibility (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types

type N (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (StyledPlot b v n) = v

styledPlot :: forall p b. Typeable p => Traversal' (StyledPlot b (V p) (N p)) p Source #

Traversal over a raw plot of a styled plot. The type of the plot must match for the traversal to be successful.

styleDynamic :: PlotStyle b v n -> DynamicPlot b v n -> StyledPlot b v n Source #

Give a DynamicPlot a concrete PlotStyle.

singleStyledPlotLegend Source #

Arguments

:: StyledPlot b v n 
-> [(n, QDiagram b v n Any, String)]
(z-order, legend pic, legend text)

Get the legend rendered entries from a single styled plot. The resulting entries are in no particular order. See also styledPlotLegends.

styledPlotLegends Source #

Arguments

:: Ord n 
=> [StyledPlot b v n] 
-> [(QDiagram b v n Any, String)]
[(legend pic, legend text)]

Render a list of legend entries, in order.

Miscellaneous

Visibility

class HasVisibility a where Source #

Class of objects that can be hidden.

Minimal complete definition

visible

Methods

visible :: Lens' a Bool Source #

Lens onto whether an object should be visible when rendered.

hidden :: Lens' a Bool Source #

The opposite of visible.

Instances

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

Defined in Plots.Axis.ColourBar

HasVisibility (MajorGridLines 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

HasVisibility (AxisLine v n) Source # 
Instance details

Defined in Plots.Axis.Line

HasVisibility (MajorTicks v n) Source # 
Instance details

Defined in Plots.Axis.Ticks

HasVisibility (MinorTicks v n) Source # 
Instance details

Defined in Plots.Axis.Ticks

HasVisibility (Legend b n) Source # 
Instance details

Defined in Plots.Legend

HasVisibility (Plot p b) Source # 
Instance details

Defined in Plots.Types

HasVisibility (SingleAxis b v n) Source # 
Instance details

Defined in Plots.Axis

HasVisibility (AxisLabel b v n) Source # 
Instance details

Defined in Plots.Axis.Labels

HasVisibility (TickLabels b v n) Source # 
Instance details

Defined in Plots.Axis.Labels

HasVisibility (Title b v n) Source # 
Instance details

Defined in Plots.Axis.Title

Methods

visible :: Lens' (Title b v n) Bool Source #

hidden :: Lens' (Title b v n) Bool Source #

HasVisibility (DynamicPlot b v n) Source # 
Instance details

Defined in Plots.Types

HasVisibility (PlotMods b v n) Source # 
Instance details

Defined in Plots.Types

HasVisibility (PlotOptions b v n) Source # 
Instance details

Defined in Plots.Types

HasVisibility (StyledPlot b v n) Source # 
Instance details

Defined in Plots.Types

hide :: (MonadState s m, HasVisibility a) => ASetter' s a -> m () Source #

Set visible to False for the given setter.

hide minorTicks          :: State (Axis b v n) ()
hide (xAxis . gridLines) :: State (Axis b v n) ()

display :: (MonadState s m, HasVisibility a) => ASetter' s a -> m () Source #

Set visible to True for the given setter.

display minorGridLines :: State (Axis b v n) ()
display colourBar      :: State (Axis b v n) ()

Orientation

class HasOrientation a where Source #

Class of things that have an orientation.

Methods

orientation :: Lens' a Orientation Source #

Lens onto the orientation of an object.

Instances

Instances details
HasOrientation Orientation Source # 
Instance details

Defined in Plots.Types

HasOrientation (BarLayout n) Source # 
Instance details

Defined in Plots.Types.Bar

HasOrientation (BarPlot n) Source # 
Instance details

Defined in Plots.Types.Bar

HasOrientation (HistogramOptions n) Source # 
Instance details

Defined in Plots.Types.Histogram

HasOrientation (HistogramPlot n) Source # 
Instance details

Defined in Plots.Types.Histogram

HasOrientation (ColourBar b n) Source # 
Instance details

Defined in Plots.Axis.ColourBar

HasOrientation (Legend b n) Source # 
Instance details

Defined in Plots.Legend

HasOrientation p => HasOrientation (Plot p b) Source # 
Instance details

Defined in Plots.Types

HasOrientation (MultiBarState b n a) Source # 
Instance details

Defined in Plots.Types.Bar

orient :: HasOrientation o => o -> a -> a -> a Source #

Pick the first a if the object has Horizontal orientation and the second a if the object has a Vertical orientation.

horizontal :: HasOrientation a => Lens' a Bool Source #

Lens onto whether an object's orientation is horizontal.

vertical :: HasOrientation a => Lens' a Bool Source #

Lens onto whether an object's orientation is vertical.

Legend entries

data LegendEntry b v n Source #

Data type for holding a legend entry.

Instances

Instances details
type N (LegendEntry b v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (LegendEntry b v n) = v

data LegendPic b v n Source #

Type allowing use of the default legend picture (depending on the plot) or a custom legend picture with access to the PlotStyle.

Constructors

DefaultLegendPic 
CustomLegendPic (PlotStyle b v n -> QDiagram b v n Any) 

Instances

Instances details
Default (LegendPic b v n) Source # 
Instance details

Defined in Plots.Types

Methods

def :: LegendPic b v n #

mkLegendEntry :: Num n => String -> LegendEntry b v n Source #

Make a legend entry with a default legendPicture and legendPrecedence 0 using the string as the legendText.

legendPicture :: Lens' (LegendEntry b v n) (LegendPic b v n) Source #

The picture used in the legend entry.

legendText :: Lens' (LegendEntry b v n) String Source #

The text used in the legend entry.

legendPrecedence :: Lens' (LegendEntry b v n) n Source #

The order in which the legend entries are rendered. If precedences are equal, the entries are put in the order they are added to the axis.

Default is 0.

Axis spec

data AxisSpec v n Source #

Information from the Axis necessary to render a Plotable.

Constructors

AxisSpec 

Instances

Instances details
type N (AxisSpec v n) Source # 
Instance details

Defined in Plots.Types

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

Defined in Plots.Types

type V (AxisSpec v n) = v

specTrans :: forall v n. Lens' (AxisSpec v n) (Transformation v n) Source #

specBounds :: forall v n. Lens' (AxisSpec v n) (v (n, n)) Source #

specScale :: forall v n. Lens' (AxisSpec v n) (v LogScale) Source #

scaleNum :: Floating n => (n, n) -> LogScale -> n -> n Source #

Scale a number by log10-ing it and linearly scaling it so it's within the same range.

specPoint :: (Applicative v, Additive v, Floating n) => AxisSpec v n -> Point v n -> Point v n Source #

Apply log scaling and the transform to a point.

Positioning

data Placement Source #

A Position is a point on an axis together with an anchor and a direction for the gap.

class HasPlacement a where Source #

Minimal complete definition

placement

Methods

placement :: Lens' a Placement Source #

placementAt :: Lens' a (V2 Rational) Source #

The position relative to the axis. V2 0 0 corresponds to the bottom left corner, V2 1 1 is the top right corner.

placementAnchor :: Lens' a (V2 Rational) Source #

The anchor used for the object being positioned. V2 0 0 corresponds to the bottom left corner, V2 1 1 is the top right corner.

gapDirection :: Lens' a (Direction V2 Rational) Source #

The direction to extend the HasGap when positioning.

class HasGap a where Source #

Methods

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

The value of the gap when rendering.

Instances

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

Defined in Plots.Axis.ColourBar

Methods

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

HasGap (Legend b n) Source # 
Instance details

Defined in Plots.Legend

Methods

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

HasGap (AxisLabel b v n) Source # 
Instance details

Defined in Plots.Axis.Labels

Methods

gap :: Lens' (AxisLabel b v n) (N (AxisLabel b v n)) Source #

HasGap (TickLabels b v n) Source # 
Instance details

Defined in Plots.Axis.Labels

Methods

gap :: Lens' (TickLabels b v n) (N (TickLabels b v n)) Source #

HasGap (Title b v n) Source # 
Instance details

Defined in Plots.Axis.Title

Methods

gap :: Lens' (Title b v n) (N (Title b v n)) Source #

placeAgainst :: (InSpace V2 n a, SameSpace a b, Enveloped a, HasOrigin b, Alignable b) => a -> Placement -> n -> b -> b Source #

A tool for aligned one object to another. Positions b around the bounding box of a by translating b.

Common positions

Inside positions

Outside positions