The ErrorBars module provides functions for
drawing graphs with errors bars. Suppose that
we have dome data:
> data = SampleData.eb2 |> Data.fromString 0 1Then
> ErrorBars.mean dataproduces a list of ponts that pass through the mean valjues of data points with given x value. For error bars with extreme ponts one standard deviatoin from the mean, use
> ErrorBars.normal 1.0 dataFor error bars with endpoints at the maximumn and minimum of the data with given x value, use
> ErrorBars.maxmin dataUse to ompute the y-centroids of the data, as in this example:
> SampleData.eb2 |> Data.fromString 0 1 |> ErrorBars.mean
[{ x = 0, y = 1 },{ x = 1, y = 2 }]Use to ompute error bars, as in this example:
> SampleData.eb2 |> Data.fromString 0 1 |> ErrorBars.normal 0.5
[{ bottom = 0.99667, y = 1, top = 1.003333, x = 0 }
,{ bottom = 1.98, y = 2, top = 2.02, x = 1 }]> SampleData.eb2 |> Data.fromString 0 1 |> ErrorBars.maxmin
[{ bottom = 0.9, y = 1, top = 1.1, x = 0 }
,{ bottom = 1.8, y = 2, top = 2.2, x = 1 }]
The type of an error bar containing (x,y) with extreme points (x,top) and (x,bottom)