XPlot


Plotly Line and Scatter Plots

Basic Line Plot

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
let basicTrace1 =
    Scatter(
        x = [1; 2; 3; 4],
        y = [10; 15; 13; 17]
    )

let basicTrace2 =
    Scatter(
        x = [1; 2; 3; 4],
        y = [16; 5; 11; 9]
    )

Figure(Data.From [basicTrace1; basicTrace2])

Line and Scatter Plot

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
let lineTrace1 =
    Scatter(
        x = [1; 2; 3; 4],
        y = [10; 15; 13; 17],
        mode = "markers"
    )

let lineTrace2 =
    Scatter(
        x = [2; 3; 4; 5],
        y = [16; 5; 11; 9],
        mode = "lines"
    )

let lineTrace3 =
    Scatter(
        x = [1; 2; 3; 4],
        y = [12; 9; 15; 12],
        mode = "lines+markers"
    )

Figure(Data.From [lineTrace1; lineTrace2; lineTrace3])

Colored and Styled Scatter Plot

  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: 
 80: 
 81: 
 82: 
 83: 
 84: 
 85: 
 86: 
 87: 
 88: 
 89: 
 90: 
 91: 
 92: 
 93: 
 94: 
 95: 
 96: 
 97: 
 98: 
 99: 
100: 
101: 
102: 
let styledTrace1 =
    Scatter(
        x = [52698; 43117],
        y = [53; 31],
        mode = "markers",
        name = "North America",
        text = ["United States"; "Canada"],
        marker =
            Marker(
                color = "rgb(164, 194, 244)",
                size = 12,
                line =
                    Line(
                        color = "white",
                        width = 0.5
                    )
            )
    )

let styledTrace2 =
    Scatter(
        x = [39317; 37236; 35650; 30066; 29570; 27159; 23557; 21046; 18007],
        y = [33; 20; 13; 19; 27; 19; 49; 44; 38],
        mode = "markers",
        name = "Europe",
        text =
            ["Germany"; "Britain"; "France"; "Spain"; "Italy"; "Czech Rep."; "Greece";
             "Poland"],
        marker =
            Marker(
                color = "rgb(255, 217, 102)",
                size = 12,
                line=
                    Line(
                        color = "white",
                        width = 0.5
                    )
            )
    )

let styledTrace3 = 
    Scatter(
        x = [42952; 37037; 33106; 17478; 9813; 5253; 4692; 3899],
        y = [23; 42; 54; 89; 14; 99; 93; 70],
        mode = "markers",
        name = "Asia/Pacific",
        text =
            ["Australia"; "Japan"; "South Korea"; "Malaysia"; "China"; "Indonesia";
             "Philippines"; "India"],
        marker =
            Marker(
                color = "rgb(234, 153, 153)",
                size = 12,
                line =
                    Line(
                        color = "white",
                        width = 0.5
                    )
            )
    )

let styledTrace4 =
    Scatter(
        x = [19097; 18601; 15595; 13546; 12026; 7434; 5419],
        y = [43; 47; 56; 80; 86; 93; 80],
        mode = "markers",
        name = "Latin America",
        text =
            ["Chile"; "Argentina"; "Mexico"; "Venezuela"; "Venezuela"; "El Salvador";
             "Bolivia"],
        marker = 
            Marker(
                color = "rgb(142, 124, 195)",
                size = 12,
                line =
                    Line(
                        color = "white",
                        width = 0.5
                    )
            )
    )

let styledLayout =
    Layout(
        title = "Quarter 1 Growth",
        xaxis =
            XAxis(
                title = "GDP per Capita",
                showgrid = false,
                zeroline = false
            ),
        yaxis =
            YAxis(
                title = "Percent",
                showline = false
            )
    )

Figure(
    Data.From [styledTrace1; styledTrace2; styledTrace3; styledTrace4],
    styledLayout
)

Line Shape Options for Interpolation

 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: 
let shapeTrace1 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [1; 3; 2; 3; 1],
        mode = "lines+markers",
        name = "'linear'",
        line = Line(shape = "linear")
    )

let shapeTrace2 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [6; 8; 7; 8; 6],
        mode = "lines+markers",
        name = "'spline'",
        text =
            ["tweak line smoothness<br>with 'smoothing' in line object";
             "tweak line smoothness<br>with 'smoothing' in line object";
             "tweak line smoothness<br>with 'smoothing' in line object";
             "tweak line smoothness<br>with 'smoothing' in line object";
             "tweak line smoothness<br>with 'smoothing' in line object";
             "tweak line smoothness<br>with 'smoothing' in line object"],
        line = Line(shape = "spline")
    )

let shapeTrace3 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [11; 13; 12; 13; 11],
        mode = "lines+markers",
        name = "'vhv'",
        line = Line(shape = "vhv")
    )

let shapeTrace4 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [16; 18; 17; 18; 16],
        mode = "lines+markers",
        name = "'hvh'",
        line = Line(shape = "hvh")
    )

let shapeTrace5 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [21; 23; 22; 23; 21],
        mode = "lines+markers",
        name = "'vh'",
        line = Line(shape = "vh")
    )

let shapeTrace6 =
    Scatter(
        x = [1; 2; 3; 4; 5],
        y = [26; 28; 27; 28; 26],
        mode = "lines+markers",
        name = "'hv'",
        line = Line(shape = "hv")
    )

let data =
    Data([shapeTrace1; shapeTrace2; shapeTrace3;
          shapeTrace4; shapeTrace5; shapeTrace6]
    )
        
let shapeLayout =
    Layout(
        legend =
            Legend(
                y = 0.5,
                traceorder = "reversed",
                font = Font(size = 16.),
                yref = "paper"
            )
    )

Figure(data, shapeLayout)
namespace XPlot
namespace XPlot.Plotly
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 basicTrace1 : Scatter

Full name: Plotly-line-scatter-plots.basicTrace1
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
val basicTrace2 : Scatter

Full name: Plotly-line-scatter-plots.basicTrace2
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 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 lineTrace1 : Scatter

Full name: Plotly-line-scatter-plots.lineTrace1
val lineTrace2 : Scatter

Full name: Plotly-line-scatter-plots.lineTrace2
val lineTrace3 : Scatter

Full name: Plotly-line-scatter-plots.lineTrace3
val styledTrace1 : Scatter

Full name: Plotly-line-scatter-plots.styledTrace1
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
Multiple items
type Line =
  new : unit -> Line
  member ShouldSerializecolor : unit -> bool
  member ShouldSerializedash : unit -> bool
  member ShouldSerializeopacity : unit -> bool
  member ShouldSerializeoutliercolor : unit -> bool
  member ShouldSerializeoutlierwidth : unit -> bool
  member ShouldSerializeshape : unit -> bool
  member ShouldSerializesmoothing : unit -> bool
  member ShouldSerializewidth : unit -> bool
  member color : obj
  ...

Full name: XPlot.Plotly.Graph.Line

--------------------
new : unit -> Line
val styledTrace2 : Scatter

Full name: Plotly-line-scatter-plots.styledTrace2
val styledTrace3 : Scatter

Full name: Plotly-line-scatter-plots.styledTrace3
val styledTrace4 : Scatter

Full name: Plotly-line-scatter-plots.styledTrace4
val styledLayout : Layout

Full name: Plotly-line-scatter-plots.styledLayout
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
val shapeTrace1 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace1
val shapeTrace2 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace2
val shapeTrace3 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace3
val shapeTrace4 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace4
val shapeTrace5 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace5
val shapeTrace6 : Scatter

Full name: Plotly-line-scatter-plots.shapeTrace6
val data : Data

Full name: Plotly-line-scatter-plots.data
val shapeLayout : Layout

Full name: Plotly-line-scatter-plots.shapeLayout
Multiple items
type Legend =
  new : unit -> Legend
  member ShouldSerializebgcolor : unit -> bool
  member ShouldSerializebordercolor : unit -> bool
  member ShouldSerializeborderwidth : unit -> bool
  member ShouldSerializefont : unit -> bool
  member ShouldSerializetraceorder : unit -> bool
  member ShouldSerializex : unit -> bool
  member ShouldSerializexanchor : unit -> bool
  member ShouldSerializexref : unit -> bool
  member ShouldSerializey : unit -> bool
  ...

Full name: XPlot.Plotly.Graph.Legend

--------------------
new : unit -> Legend
property Legend.y: float
Multiple items
type Font =
  new : unit -> Font
  member ShouldSerializecolor : unit -> bool
  member ShouldSerializefamily : unit -> bool
  member ShouldSerializeoutlinecolor : unit -> bool
  member ShouldSerializesize : unit -> bool
  member color : string
  member family : string
  member outlinecolor : string
  member size : float
  member color : string with set
  ...

Full name: XPlot.Plotly.Graph.Font

--------------------
new : unit -> Font
Fork me on GitHub