XPlot


Plotly 2D Histograms

Full source

2D Histogram of a Bivariate Normal Distribution

1: 
2: 
3: 
4: 
5: 
6: 
7: 
Histogram2d(
    x = x,
    y = y
)
|> Chart.Plot
|> Chart.WithWidth 700
|> Chart.WithHeight 500

2D Histogram Binning and Styling Options

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
Histogram2d(
    x = x,
    y = y,
    histnorm = "probability",
    autobinx = false,
    xbins =
        Xbins(
            start = -3.,
            ``end`` = 3.,
            size = 0.1
        ),
    autobiny = false,
    ybins =
        Ybins(
            start = -2.5,
            ``end`` = 4.,
            size = 0.1
        ),
    colorscale =
        [
            [box 0; box "rgb(12,51,131)"]
            [0.25; "rgb(10,136,186)"]
            [0.5; "rgb(242,211,56)"]
            [0.75; "rgb(242,143,56)"]
            [1; "rgb(217,30,30)"]
        ]
)
|> Chart.Plot
|> Chart.WithWidth 700
|> Chart.WithHeight 500

2D Histogram Overlaid with a Scatter Chart

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
let trace1 =
    Scatter(
        x = x0,
        y = y0,
        mode = "markers",
        marker =
            Marker(
                symbol = "circle",
                opacity = 0.7
            )
    )

let trace2 =
    Scatter(
        x = x1,
        y = y1,
        mode = "markers",
        marker =
            Marker(
                symbol = "square",
                opacity = 0.7
            )
    )

let trace3 =
    Histogram2d(
        x = x',
        y = y'
    )

let layout = Layout(showlegend = false)

[trace1 :> Trace; trace2 :> _; trace3 :> _]
|> Chart.Plot
|> Chart.WithWidth 700
|> Chart.WithHeight 500
|> Chart.WithLayout layout
namespace MathNet
namespace MathNet.Numerics
namespace MathNet.Numerics.Distributions
namespace XPlot
namespace XPlot.Plotly
val normal : Normal

Full name: Plotly-2d-histograms.normal
Multiple items
type Normal =
  new : unit -> Normal + 3 overloads
  member CumulativeDistribution : x:float -> float
  member Density : x:float -> float
  member DensityLn : x:float -> float
  member Entropy : float
  member InverseCumulativeDistribution : p:float -> float
  member Maximum : float
  member Mean : float
  member Median : float
  member Minimum : float
  ...

Full name: MathNet.Numerics.Distributions.Normal

--------------------
Normal() : unit
Normal(randomSource: System.Random) : unit
Normal(mean: float, stddev: float) : unit
Normal(mean: float, stddev: float, randomSource: System.Random) : unit
val x : seq<float>

Full name: Plotly-2d-histograms.x
Normal.Samples() : System.Collections.Generic.IEnumerable<float>
Normal.Samples(values: float []) : unit
module Seq

from Microsoft.FSharp.Collections
val take : count:int -> source:seq<'T> -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.take
val y : seq<float>

Full name: Plotly-2d-histograms.y
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>

Full name: Microsoft.FSharp.Collections.Seq.map
val x : float
val x0 : seq<float>

Full name: Plotly-2d-histograms.x0
val y0 : seq<float>

Full name: Plotly-2d-histograms.y0
val uniform : ContinuousUniform

Full name: Plotly-2d-histograms.uniform
Multiple items
type ContinuousUniform =
  new : unit -> ContinuousUniform + 2 overloads
  member CumulativeDistribution : x:float -> float
  member Density : x:float -> float
  member DensityLn : x:float -> float
  member Entropy : float
  member InverseCumulativeDistribution : p:float -> float
  member LowerBound : float
  member Maximum : float
  member Mean : float
  member Median : float
  ...

Full name: MathNet.Numerics.Distributions.ContinuousUniform

--------------------
ContinuousUniform() : unit
ContinuousUniform(lower: float, upper: float) : unit
ContinuousUniform(lower: float, upper: float, randomSource: System.Random) : unit
val x1 : seq<float>

Full name: Plotly-2d-histograms.x1
ContinuousUniform.Samples() : System.Collections.Generic.IEnumerable<float>
ContinuousUniform.Samples(values: float []) : unit
val y1 : seq<float>

Full name: Plotly-2d-histograms.y1
val x' : seq<float>

Full name: Plotly-2d-histograms.x'
val concat : sources:seq<#seq<'T>> -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.concat
val y' : seq<float>

Full name: Plotly-2d-histograms.y'
Multiple items
type Histogram2d =
  inherit Trace
  new : unit -> Histogram2d
  member ShouldSerializeautobinx : unit -> bool
  member ShouldSerializeautobiny : unit -> bool
  member ShouldSerializeautocolorscale : unit -> bool
  member ShouldSerializecolorbar : unit -> bool
  member ShouldSerializecolorscale : unit -> bool
  member ShouldSerializeconnectgaps : unit -> bool
  member ShouldSerializedx : unit -> bool
  member ShouldSerializedy : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Histogram2d

--------------------
new : unit -> Histogram2d
property Histogram2d.x: obj
property Histogram2d.y: obj
type Chart =
  static member Area : data:seq<#seq<'a1 * 'a2>> -> PlotlyChart (requires 'a1 :> key and 'a2 :> value)
  static member Area : data:seq<#key * #value> -> PlotlyChart
  static member Area : data:seq<#value> -> PlotlyChart
  static member Bar : data:seq<#seq<'a1 * 'a2>> -> PlotlyChart (requires 'a1 :> key and 'a2 :> value)
  static member Bar : data:seq<#key * #value> -> PlotlyChart
  static member Bar : data:seq<#value> -> PlotlyChart
  static member Bubble : data:seq<#key * #value * #value> -> PlotlyChart
  static member Column : data:seq<#seq<'a1 * 'a2>> -> PlotlyChart (requires 'a1 :> key and 'a2 :> value)
  static member Column : data:seq<#key * #value> -> PlotlyChart
  static member Column : data:seq<#value> -> PlotlyChart
  ...

Full name: XPlot.Plotly.Chart
static member Chart.Plot : data:seq<#Trace> -> PlotlyChart
static member Chart.Plot : data:Trace -> PlotlyChart
static member Chart.Plot : data:seq<#Trace> * layout:Layout -> PlotlyChart
static member Chart.Plot : data:Trace * layout:Layout -> PlotlyChart
static member Chart.WithWidth : width:int -> chart:PlotlyChart -> PlotlyChart
static member Chart.WithHeight : height:int -> chart:PlotlyChart -> PlotlyChart
Multiple items
type Xbins =
  new : unit -> Xbins
  member ShouldSerializeend : unit -> bool
  member ShouldSerializesize : unit -> bool
  member ShouldSerializestart : unit -> bool
  member end : float
  member size : obj
  member start : float
  member end : float with set
  member size : obj with set
  member start : float with set

Full name: XPlot.Plotly.Graph.Xbins

--------------------
new : unit -> Xbins
Multiple items
type Ybins =
  new : unit -> Ybins
  member ShouldSerializeend : unit -> bool
  member ShouldSerializesize : unit -> bool
  member ShouldSerializestart : unit -> bool
  member end : float
  member size : obj
  member start : float
  member end : float with set
  member size : obj with set
  member start : float with set

Full name: XPlot.Plotly.Graph.Ybins

--------------------
new : unit -> Ybins
val box : value:'T -> obj

Full name: Microsoft.FSharp.Core.Operators.box
val trace1 : Scatter

Full name: Plotly-2d-histograms.trace1
Multiple items
type Scatter =
  inherit Trace
  new : unit -> Scatter
  member ShouldSerializeconnectgaps : unit -> bool
  member ShouldSerializedx : unit -> bool
  member ShouldSerializedy : unit -> bool
  member ShouldSerializeerror_x : unit -> bool
  member ShouldSerializeerror_y : unit -> bool
  member ShouldSerializefill : unit -> bool
  member ShouldSerializefillcolor : unit -> bool
  member ShouldSerializehoverinfo : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Scatter

--------------------
new : unit -> Scatter
property Scatter.x: obj
property Scatter.y: obj
Multiple items
type Marker =
  new : unit -> Marker
  member ShouldSerializeautocolorscale : unit -> bool
  member ShouldSerializecauto : unit -> bool
  member ShouldSerializecmax : unit -> bool
  member ShouldSerializecmin : unit -> bool
  member ShouldSerializecolor : unit -> bool
  member ShouldSerializecolorbar : unit -> bool
  member ShouldSerializecolors : unit -> bool
  member ShouldSerializecolorscale : unit -> bool
  member ShouldSerializecolorsrc : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Marker

--------------------
new : unit -> Marker
val trace2 : Scatter

Full name: Plotly-2d-histograms.trace2
val trace3 : Histogram2d

Full name: Plotly-2d-histograms.trace3
val layout : Layout

Full name: Plotly-2d-histograms.layout
Multiple items
module Layout

from XPlot.Plotly

--------------------
type Layout =
  new : unit -> Layout
  member ShouldSerializeangularaxis : unit -> bool
  member ShouldSerializeannotations : unit -> bool
  member ShouldSerializeautosize : unit -> bool
  member ShouldSerializebargap : unit -> bool
  member ShouldSerializebargroupgap : unit -> bool
  member ShouldSerializebarmode : unit -> bool
  member ShouldSerializeboxmode : unit -> bool
  member ShouldSerializedirection : unit -> bool
  member ShouldSerializedragmode : unit -> bool
  ...

Full name: XPlot.Plotly.Layout.Layout

--------------------
new : unit -> Layout
Multiple items
type Trace =
  new : unit -> Trace
  member ShouldSerializename : unit -> bool
  member name : string
  member name : string with set

Full name: XPlot.Plotly.Graph.Trace

--------------------
new : unit -> Trace
static member Chart.WithLayout : layout:Layout -> chart:PlotlyChart -> PlotlyChart
Fork me on GitHub