XPlot


Plotly Contour Plots

Basic Contour Plot

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
let trace =
    Contour(
        z = z,
        x = x,
        y = y
    )

Figure(Data.From [trace])

2D Histogram Contour Plot with Histogram Subplots

 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: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
79: 
let trace1 =
    Scatter(
        x = x1,
        y = y1,
        mode = "markers",
        name = "points",
        marker =
            Marker(
                color = "rgb(102,0,0)",
                size = 2,
                opacity = 0.4
            )
    )

let trace2 =
    Histogram2dContour(
        x = x1,
        y = y1,
        name = "density",
        ncontours = 20.,
        colorscale = "Hot",
        reversescale = true,
        showscale = false
    )

let trace3 =
    Histogram(
        x = x1,
        name = "x density",
        marker = Marker(color = "rgb(102,0,0)"),
        yaxis = "y2"
    )

let trace4 =
    Histogram(
        y = y1,
        name = "y density",
        marker = Marker(color = "rgb(102,0,0)"),
        xaxis = "x2"
    )

let data' = Data [trace1; trace2; trace3; trace4]

let layout =
    Layout(
        showlegend = false,
        autosize = false,
        width = 600.,
        height = 550.,
        xaxis =
            XAxis(
                domain = [|0.; 0.85|],
                showgrid = false,
                zeroline = false
            ),
        yaxis =
            YAxis(
                domain = [|0.; 0.85|],
                showgrid = false,
                zeroline = false
            ),
        margin = Margin(t = 50.),
        hovermode = "closest",
        bargap = 0.,
        xaxis2 =
            XAxis(
                domain = [|0.85; 1.|],
                showgrid = false,
                zeroline = false
            ),
        yaxis2 =
            YAxis(
                domain = [|0.85; 1.|],
                showgrid = false,
                zeroline = false
            )
    )

Figure(data', layout)
namespace XPlot
namespace XPlot.Plotly
namespace MathNet
namespace MathNet.Numerics
namespace MathNet.Numerics.Distributions
namespace System
type Plotly =
  private new : unit -> Plotly
  static member Signin : username:string * password:string -> unit

Full name: XPlot.Plotly.Plotly
static member Plotly.Signin : username:string * password:string -> unit
module MyCredentials
val userAndKey : string * string

Full name: MyCredentials.userAndKey
val size : int

Full name: Plotly-contour-plots.size
val x : float []

Full name: Plotly-contour-plots.x
type Generate =
  static member Fibonacci : length:int -> BigInteger[]
  static member FibonacciSequence : unit -> IEnumerable<BigInteger>
  static member Gaussian : length:int * mean:float * standardDeviation:float -> float[]
  static member GaussianSequence : mean:float * standardDeviation:float -> IEnumerable<float>
  static member Impulse : length:int * amplitude:float * delay:int -> float[]
  static member ImpulseSequence : amplitude:float * delay:int -> IEnumerable<float>
  static member LinearRange : start:int * stop:int -> float[] + 2 overloads
  static member LinearRangeMap<'T> : start:float * step:float * stop:float * map:Func<float, 'T> -> 'T[]
  static member LinearSpaced : length:int * start:float * stop:float -> float[]
  static member LinearSpacedMap<'T> : length:int * start:float * stop:float * map:Func<float, 'T> -> 'T[]
  ...

Full name: MathNet.Numerics.Generate
Generate.LinearSpaced(length: int, start: float, stop: float) : float []
type Math =
  static val PI : float
  static val E : float
  static member Abs : value:sbyte -> sbyte + 6 overloads
  static member Acos : d:float -> float
  static member Asin : d:float -> float
  static member Atan : d:float -> float
  static member Atan2 : y:float * x:float -> float
  static member BigMul : a:int * b:int -> int64
  static member Ceiling : d:decimal -> decimal + 1 overload
  static member Cos : d:float -> float
  ...

Full name: System.Math
field Math.PI = 3.14159265359
val y : float []

Full name: Plotly-contour-plots.y
val z : float [,]

Full name: Plotly-contour-plots.z
module Array2D

from Microsoft.FSharp.Collections
val create : length1:int -> length2:int -> value:'T -> 'T [,]

Full name: Microsoft.FSharp.Collections.Array2D.create
val i : int32
val j : int32
val r2 : float
val sin : value:'T -> 'T (requires member Sin)

Full name: Microsoft.FSharp.Core.Operators.sin
val cos : value:'T -> 'T (requires member Cos)

Full name: Microsoft.FSharp.Core.Operators.cos
val log : value:'T -> 'T (requires member Log)

Full name: Microsoft.FSharp.Core.Operators.log
val t : float []

Full name: Plotly-contour-plots.t
val normal : Normal

Full name: Plotly-contour-plots.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: Random) : unit
Normal(mean: float, stddev: float) : unit
Normal(mean: float, stddev: float, randomSource: Random) : unit
val sample : float []

Full name: Plotly-contour-plots.sample
Normal.Samples() : 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 toArray : source:seq<'T> -> 'T []

Full name: Microsoft.FSharp.Collections.Seq.toArray
val x1 : float []

Full name: Plotly-contour-plots.x1
type Array =
  member Clone : unit -> obj
  member CopyTo : array:Array * index:int -> unit + 1 overload
  member GetEnumerator : unit -> IEnumerator
  member GetLength : dimension:int -> int
  member GetLongLength : dimension:int -> int64
  member GetLowerBound : dimension:int -> int
  member GetUpperBound : dimension:int -> int
  member GetValue : params indices:int[] -> obj + 7 overloads
  member Initialize : unit -> unit
  member IsFixedSize : bool
  ...

Full name: System.Array
val mapi : mapping:(int -> 'T -> 'U) -> array:'T [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.mapi
val i : int
val x : float
val y1 : float []

Full name: Plotly-contour-plots.y1
val trace : Contour

Full name: Plotly-contour-plots.trace
Multiple items
type Contour =
  inherit Trace
  new : unit -> Contour
  member ShouldSerializeautocontour : unit -> bool
  member ShouldSerializecolorbar : unit -> bool
  member ShouldSerializecolorscale : unit -> bool
  member ShouldSerializeconnectgaps : unit -> bool
  member ShouldSerializecontours : unit -> bool
  member ShouldSerializedx : unit -> bool
  member ShouldSerializedy : unit -> bool
  member ShouldSerializeline : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Contour

--------------------
new : unit -> Contour
property Contour.z: obj
property Contour.x: obj
property Contour.y: obj
Multiple items
type Figure =
  new : data:Data * ?Layout:Layout -> Figure
  member GetInlineHtml : filename:string -> string
  member Plot : filename:string -> PlotlyResponse option
  member Fileopt : string
  member Height : int
  member Layout : Layout option
  member Origin : string
  member Response : PlotlyResponse option
  member Width : int
  member Fileopt : string with set
  ...

Full name: XPlot.Plotly.Figure

--------------------
new : data:Data * ?Layout:Layout -> Figure
Multiple items
namespace System.Data

--------------------
namespace Microsoft.FSharp.Data

--------------------
type Data =
  new : traces:seq<Trace> -> Data
  member Json : string
  static member From : traces:seq<#Trace> -> Data

Full name: XPlot.Plotly.Data

--------------------
new : traces:seq<Trace> -> Data
static member Data.From : traces:seq<#Trace> -> Data
val trace1 : Scatter

Full name: Plotly-contour-plots.trace1
Multiple items
type Scatter =
  inherit Trace
  new : unit -> Scatter
  member ShouldSerializeconnectgaps : unit -> bool
  member ShouldSerializeerror_x : unit -> bool
  member ShouldSerializeerror_y : unit -> bool
  member ShouldSerializefill : unit -> bool
  member ShouldSerializefillcolor : unit -> bool
  member ShouldSerializeline : unit -> bool
  member ShouldSerializemarker : unit -> bool
  member ShouldSerializemode : 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 ShouldSerializecauto : unit -> bool
  member ShouldSerializecmax : unit -> bool
  member ShouldSerializecmin : unit -> bool
  member ShouldSerializecolor : unit -> bool
  member ShouldSerializecolorscale : unit -> bool
  member ShouldSerializeline : unit -> bool
  member ShouldSerializemaxdisplayed : unit -> bool
  member ShouldSerializeopacity : unit -> bool
  member ShouldSerializeoutliercolor : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Marker

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

Full name: Plotly-contour-plots.trace2
Multiple items
type Histogram2dContour =
  inherit Trace
  new : unit -> Histogram2dContour
  member ShouldSerializeautobinx : unit -> bool
  member ShouldSerializeautobiny : unit -> bool
  member ShouldSerializeautocontour : unit -> bool
  member ShouldSerializecolorbar : unit -> bool
  member ShouldSerializecolorscale : unit -> bool
  member ShouldSerializecontours : unit -> bool
  member ShouldSerializehistfunc : unit -> bool
  member ShouldSerializehistnorm : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Histogram2dContour

--------------------
new : unit -> Histogram2dContour
property Histogram2dContour.x: obj
property Histogram2dContour.y: obj
val trace3 : Histogram

Full name: Plotly-contour-plots.trace3
Multiple items
type Histogram =
  inherit Trace
  new : unit -> Histogram
  member ShouldSerializeautobinx : unit -> bool
  member ShouldSerializeautobiny : unit -> bool
  member ShouldSerializeerror_x : unit -> bool
  member ShouldSerializeerror_y : unit -> bool
  member ShouldSerializehistfunc : unit -> bool
  member ShouldSerializehistnorm : unit -> bool
  member ShouldSerializemarker : unit -> bool
  member ShouldSerializename : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Histogram

--------------------
new : unit -> Histogram
property Histogram.x: obj
val trace4 : Histogram

Full name: Plotly-contour-plots.trace4
property Histogram.y: obj
val data' : Data

Full name: Plotly-contour-plots.data'
val layout : Layout

Full name: Plotly-contour-plots.layout
Multiple items
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 ShouldSerializebarnorm : unit -> bool
  member ShouldSerializeboxgap : unit -> bool
  member ShouldSerializeboxgroupgap : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Layout

--------------------
new : unit -> Layout
Multiple items
type XAxis =
  new : unit -> XAxis
  member ShouldSerializeanchor : unit -> bool
  member ShouldSerializeautorange : unit -> bool
  member ShouldSerializeautotick : unit -> bool
  member ShouldSerializebackgroundcolor : unit -> bool
  member ShouldSerializedomain : unit -> bool
  member ShouldSerializedtick : unit -> bool
  member ShouldSerializeexponentformat : unit -> bool
  member ShouldSerializegridcolor : unit -> bool
  member ShouldSerializegridwidth : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.XAxis

--------------------
new : unit -> XAxis
Multiple items
type YAxis =
  new : unit -> YAxis
  member ShouldSerializeanchor : unit -> bool
  member ShouldSerializeautorange : unit -> bool
  member ShouldSerializeautotick : unit -> bool
  member ShouldSerializebackgroundcolor : unit -> bool
  member ShouldSerializedomain : unit -> bool
  member ShouldSerializedtick : unit -> bool
  member ShouldSerializeexponentformat : unit -> bool
  member ShouldSerializegridcolor : unit -> bool
  member ShouldSerializegridwidth : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.YAxis

--------------------
new : unit -> YAxis
Multiple items
type Margin =
  new : unit -> Margin
  member ShouldSerializeautoexpand : unit -> bool
  member ShouldSerializeb : unit -> bool
  member ShouldSerializel : unit -> bool
  member ShouldSerializepad : unit -> bool
  member ShouldSerializer : unit -> bool
  member ShouldSerializet : unit -> bool
  member autoexpand : string
  member b : float
  member l : float
  ...

Full name: XPlot.Plotly.Graph.Margin

--------------------
new : unit -> Margin
property Margin.t: float
Fork me on GitHub