plots-0.1.0.2: Diagrams based plotting library.

Safe HaskellNone
LanguageHaskell2010

Plots.Legend

Contents

Synopsis

Legend

data Legend b n Source #

The data type to describe how to draw a legend. For legend entries see LegendEntry.

Instances

(TypeableFloat n, Renderable (Text n) b) => Default (Legend b n) Source # 

Methods

def :: Legend b n #

TypeableFloat n => HasStyle (Legend b n) Source # 

Methods

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

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

Methods

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

HasOrientation (Legend b n) Source # 
HasVisibility (Legend b n) Source # 
HasLegend (Legend b n) b Source # 
type V (Legend b n) Source # 
type V (Legend b n) = V2
type N (Legend b n) Source # 
type N (Legend b n) = n

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

Minimal complete definition

legend

Methods

legend :: Lens' a (Legend b (N a)) Source #

Lens onto the Legend of something.

legendPlacement :: Lens' a Placement Source #

The Placement of the legend relative to the Axis.

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

The gap between the legend and the axis.

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

The style applied to the surronding box of the legend.

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

The spacing between entries in the legend.

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

The space given for the text in the legend.

legendTextFunction :: Lens' a (String -> QDiagram b V2 (N a) Any) Source #

The function to generate the legend text.

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

The style applied to the legend text.

legendOrientation :: Lens' a Orientation Source #

The way the legend entries are listed. (This will likely be replaced by a grid-like system)

Drawing a legend

drawLegend Source #

Arguments

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

bounding box to place legend against

-> [(QDiagram b V2 n Any, String)]

diagram pictures along with their key

-> Legend b n

options for drawing the legend

-> QDiagram b V2 n Any

rendered legend

Draw a legend to the bounding box using the legend entries and legend options.