machination-1.0.0: Plot charts as unicode strings.

Copyright© 2018-2020 IOHK
LicenseMPL-2.0
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Plot.Text.Histogram

Description

Plot Histogram as unicode strings; for terminal plotting. For example, one could plot answers and their frequencies to the question:

"Who's your favorite metal band?"

plot $ Histogram
    { width  = 80
    , height = 24
    , bins   =
        [ ( "Metallica", 78 )
        , ( "Iron Maiden", 61 )
        , ( "Slayer", 16 )
        , ( "Dimmu Borgir", 3 )
        , ( "Ghost", 48 )
        ]
    }
78 ┤┌─────────────┐
   ││             │
   ││             │
   ││             │
   ││             │
62 ┤│             │
   ││             ├─────────────┐
   ││             │             │
   ││             │             │
   ││             │             │
47 ┤│             │             │                            ┌─────────────┐
   ││             │             │                            │             │
   ││             │             │                            │             │
   ││             │             │                            │             │
   ││             │             │                            │             │
31 ┤│             │             │                            │             │
   ││             │             │                            │             │
   ││             │             │                            │             │
   ││             │             │                            │             │
   ││             │             │                            │             │
16 ┤│             │             ├─────────────┐              │             │
   ││             │             │             │              │             │
   ││             │             │             │              │             │
   ││             │             │             │              │             │
   ││             │             │             ├──────────────┤             │
       Metallica    Iron Maiden     Slayer      Dimmu Borgir      Ghost
Synopsis

Documentation

data Histogram Source #

Model a distribution as an Histogram. This representation works for continuous non-overlapping distributions. Axes are labelled automatically based on the bins.

Constructors

Histogram 

Fields