3D Cone Plots in F#

How to format axes of 3D Cone plots in F# with Plotly.


Plotly is known for its graphing libraries, but it's also a broader ecosystem for building interactive data apps, AI data analysis tools, and deploying and hosting Dash apps. Explore the full set of tools and platforms designed to help turn data into action. Discover Plotly.

Note: We are retiring documentation for R, MATLAB, Julia, and F#. Learn more about this change here.

In [1]:
#r "nuget: Plotly.NET, 2.0.0-preview.6"
#r "nuget: Plotly.NET.Interactive, 2.0.0-preview.6"
#r "nuget: FSharp.Data, 4.2.2"
Installed Packages
  • FSharp.Data, 4.2.2
  • Plotly.NET, 2.0.0-preview.6
  • Plotly.NET.Interactive, 2.0.0-preview.6

Loading extensions from Plotly.NET.Interactive.dll

Added Kernel Extension including formatters for Plotly.NET charts.

Basic 3D Cone

In [2]:
open System
open Plotly.NET

let cone3d =
    Trace3d.initCone
        (fun cone3d ->
            cone3d?x <- [1]
            cone3d?y <- [1]
            cone3d?z <- [1]
            cone3d?u <- [1]
            cone3d?v <- [1]
            cone3d?w <- [0]
            cone3d?colorscale<-"Blues"
            cone3d?sizemode<-"absolute"
            cone3d?sizeref<- 20,
            cone3d?anchor<-"tip"
            cone3d
            )
    |> GenericChart.ofTraceObject
In [3]:
cone3d
Out[3]:

Multiple 3D Cones

In [4]:
open System
open Plotly.NET


let cone3d =
    Trace3d.initCone
        (fun cone3d ->
            cone3d?x<-[1; 2; 3]
            cone3d?y<-[1; 2; 3]
            cone3d?z<-[1; 2; 3]
            cone3d?u<-[1; 0; 0]
            cone3d?v<-[0; 3; 0]
            cone3d?w<-[0; 0; 2]
            cone3d?sizemode<-"absolute"
            cone3d?sizeref<-2
            cone3d?anchor<-"tip"
            cone3d
            )
    |> GenericChart.ofTraceObject
In [5]:
cone3d
Out[5]: