// can't yet format YamlFrontmatter (["title: Histograms"; "category: Distribution Charts"; "categoryindex: 5"; "index: 1"], Some { StartLine = 2 StartColumn = 0 EndLine = 6 EndColumn = 8 }) to pynb markdown

In [ ]:
#r "nuget: Plotly.NET, 2.0.0-preview.7"
#r "nuget: Plotly.NET.Interactive, 2.0.0-preview.7"

Histograms

BinderScriptNotebook

Summary: This example shows how to create a one-dimensional histogram of a data samples in F#.

let's first create some data for the purpose of creating example charts:

In [3]:
open Plotly.NET 

let rnd = System.Random()
let x = [for i=0 to 500 do yield rnd.NextDouble() ]

A histogram consisting of rectangles whose area is proportional to the frequency of a variable and whose width is equal to the class interval. The histogram chart represents the distribution of numerical data and can be created using the Chart.Histogram function:.

In [4]:
let histo1 =
    x
    |> Chart.Histogram
    |> Chart.withSize(500.,500.)
In [ ]:
histo1
Out[ ]: