Chart-1.9.3: A library for generating 2D Charts and Plots

Safe Haskell | None
Language | Haskell98

Graphics.Rendering.Chart.Plot.Histogram

Contents

- Histograms
- Accessors

Synopsis

- data PlotHist x y = PlotHist {
  - _plot_hist_title :: String
  - _plot_hist_bins :: Int
  - _plot_hist_values :: [x]
  - _plot_hist_no_zeros :: Bool
  - _plot_hist_range :: Maybe (x, x)
  - _plot_hist_drop_lines :: Bool
  - _plot_hist_fill_style :: FillStyle
  - _plot_hist_line_style :: LineStyle
  - _plot_hist_norm_func :: Double -> Int -> y
  }
- histToPlot :: (RealFrac x, Num y, Ord y) => PlotHist x y -> Plot x y
- defaultPlotHist :: PlotHist x Int
- defaultFloatPlotHist :: PlotHist x Double
- defaultNormedPlotHist :: PlotHist x Double
- plot_hist_title :: forall x y. Lens' (PlotHist x y) String
- plot_hist_bins :: forall x y. Lens' (PlotHist x y) Int
- plot_hist_values :: forall x y. Lens' (PlotHist x y) [x]
- plot_hist_no_zeros :: forall x y. Lens' (PlotHist x y) Bool
- plot_hist_range :: forall x y. Lens' (PlotHist x y) (Maybe (x, x))
- plot_hist_drop_lines :: forall x y. Lens' (PlotHist x y) Bool
- plot_hist_line_style :: forall x y. Lens' (PlotHist x y) LineStyle
- plot_hist_fill_style :: forall x y. Lens' (PlotHist x y) FillStyle
- plot_hist_norm_func :: forall x y y. Lens (PlotHist x y) (PlotHist x y) (Double -> Int -> y) (Double -> Int -> y)

# Histograms

data PlotHist x y Source #

Constructors

PlotHist |

Fields

- _plot_hist_title :: String

  Plot title

- _plot_hist_bins :: Int

  Number of bins

- _plot_hist_values :: [x]

  Values to histogram

- _plot_hist_no_zeros :: Bool

  Don't attempt to plot bins with zero counts. Useful when the y-axis is logarithmically scaled.

- _plot_hist_range :: Maybe (x, x)

  Override the range of the histogram. If `Nothing` the range of `_plot_hist_values` is used.

  Note that any normalization is always computed over the full data set, including samples not falling in the histogram range.

- _plot_hist_drop_lines :: Bool

  Plot vertical lines between bins

- _plot_hist_fill_style :: FillStyle

  Fill style of the bins

- _plot_hist_line_style :: LineStyle

  Line style of the bin outlines

- _plot_hist_norm_func :: Double -> Int -> y

  Normalization function

#### Instances

Instances details

Default (PlotHist x Int) Source # |
Instance details Defined in Graphics.Rendering.Chart.Plot.Histogram Methods def :: PlotHist x Int Source #

histToPlot :: (RealFrac x, Num y, Ord y) => PlotHist x y -> Plot x y Source #

Convert a `PlotHist` to a `Plot`

N.B. In principle this should be Chart's `ToPlot` class but unfortunately this does not allow us to set bounds on the x and y axis types, hence the need for this function.

defaultPlotHist :: PlotHist x Int Source #

The default style is an unnormalized histogram of 20 bins.

defaultFloatPlotHist :: PlotHist x Double Source #

`defaultPlotHist` but with real counts

defaultNormedPlotHist :: PlotHist x Double Source #

`defaultPlotHist` but normalized such that the integral of the histogram is one.

# Accessors

plot_hist_title :: forall x y. Lens' (PlotHist x y) String Source #

plot_hist_bins :: forall x y. Lens' (PlotHist x y) Int Source #

plot_hist_values :: forall x y. Lens' (PlotHist x y) [x] Source #

plot_hist_no_zeros :: forall x y. Lens' (PlotHist x y) Bool Source #

plot_hist_range :: forall x y. Lens' (PlotHist x y) (Maybe (x, x)) Source #

plot_hist_drop_lines :: forall x y. Lens' (PlotHist x y) Bool Source #

plot_hist_line_style :: forall x y. Lens' (PlotHist x y) LineStyle Source #

plot_hist_fill_style :: forall x y. Lens' (PlotHist x y) FillStyle Source #

plot_hist_norm_func :: forall x y y. Lens (PlotHist x y) (PlotHist x y) (Double -> Int -> y) (Double -> Int -> y) Source #