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

Safe HaskellNone
LanguageHaskell98

Graphics.Rendering.Chart.Plot.Histogram

Contents

Synopsis

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

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_bins :: forall x y. Lens' (PlotHist x y) Int Source

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

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

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