Polar charts
Summary: This example shows how to create polar charts in F#.
Let's first create some data for the purpose of creating example charts:
open Plotly.NET
// radial coordinates
let radial = [ 1; 2; 3; 4; 5; 6; 7 ]
// angular coordinates
let theta = [ 0; 45; 90; 135; 200; 320; 184 ]
A polar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point.
The relative position and angle of the axes is typically uninformative.
In Polar Charts, a series is represented by a closed curve that connects points in the polar coordinate system. Each data point is determined by the distance from the pole (the radial coordinate) and the angle from the fixed direction (the angular coordinate).
Polar point charts
Use Chart.PointPolar to create a polar plot that displays points on a polar coordinate system:
let pointPolar = Chart.PointPolar(r = radial, theta = theta)
Polar line charts
Use Chart.LinePolar to create a polar plot that displays a line connecting input the data on a polar coordinate system.
You can, for example, change the line style using Chart.withLineStyle
let linePolar =
Chart.LinePolar(r = radial, theta = theta)
|> Chart.withLineStyle (Color = Color.fromString "purple", Dash = StyleParam.DrawingStyle.DashDot)
Polar Spline charts
Use Chart.SpinePolar to create a polar plot that displays a smoothed line connecting input the data on a polar coordinate system.
As for all other plots above, you can, for example, add labels to each datum:
let splinePolar =
Chart.SplinePolar(
r = radial,
theta = theta,
MultiText = [ "one"; "two"; "three"; "four"; "five"; "six"; "seven" ],
TextPosition = StyleParam.TextPosition.TopCenter,
ShowMarkers = true
)
<summary> Contains mutable global default values. Changing these values will apply the default values to all consecutive Chart generations. </summary>
type DisplayOptions = inherit DynamicObj new: unit -> DisplayOptions static member addAdditionalHeadTags: additionalHeadTags: XmlNode list -> (DisplayOptions -> DisplayOptions) static member addChartDescription: description: XmlNode list -> (DisplayOptions -> DisplayOptions) static member combine: first: DisplayOptions -> second: DisplayOptions -> DisplayOptions static member getAdditionalHeadTags: displayOpts: DisplayOptions -> XmlNode list static member getChartDescription: displayOpts: DisplayOptions -> XmlNode list static member getDocumentCharset: displayOpts: DisplayOptions -> string static member getDocumentDescription: displayOpts: DisplayOptions -> string static member getDocumentFavicon: displayOpts: DisplayOptions -> XmlNode ...
--------------------
new: unit -> Plotly.NET.DisplayOptions
<summary> Sets how plotly is referenced in the head of html docs. </summary>
static member Chart.PointPolar: rEncoded: EncodedTypedArray * thetaEncoded: EncodedTypedArray * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'a * ?MultiText: 'a seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a :> System.IConvertible)
static member Chart.PointPolar: r: #System.IConvertible seq * theta: #System.IConvertible seq * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'c * ?MultiText: 'c seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'c :> System.IConvertible)
<summary> Creates a polar point plot. PointPolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales as points. </summary>
<param name="r">Sets the radial coordinates of the plotted data</param>
<param name="theta">Sets the angular coordinates of the plotted data</param>
<param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
<param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
<param name="Opacity">Sets the opactity of the trace</param>
<param name="MultiOpacity">Sets the opactity of individual datum markers</param>
<param name="Text">Sets a text associated with each datum</param>
<param name="MultiText">Sets individual text for each datum</param>
<param name="TextPosition">Sets the position of text associated with each datum</param>
<param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
<param name="MarkerColor">Sets the color of the marker</param>
<param name="MarkerColorScale">Sets the colorscale of the marker</param>
<param name="MarkerOutline">Sets the outline of the marker</param>
<param name="MarkerSymbol">Sets the marker symbol for each datum</param>
<param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
<param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
<param name="UseWebGL">If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once.</param>
<param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
<summary> The central type that gets created by all Chart constructors is GenericChart, which itself represents either a single chart or a multi chart (as a Discriminate Union type). A GenericChart consists of four top level objects: Trace (multiple of those in the case of a MultiChart), Layout, Config, and DisplayOptions. - `Trace` is in principle the representation of a dataset on a chart, including for example the data itself, color and shape of the visualization, etc. - `Layout` is everything of the chart that is not dataset specific - e.g. the shape and style of axes, the chart title, etc. - `Config` is an object that configures high level properties of the chart like making all chart elements editable or the tool bar on top - `DisplayOptions` is an object that contains meta information about how the html document that contains the chart. </summary>
static member Chart.LinePolar: rEncoded: EncodedTypedArray * thetaEncoded: EncodedTypedArray * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'a * ?MultiText: 'a seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a :> System.IConvertible)
static member Chart.LinePolar: r: #System.IConvertible seq * theta: #System.IConvertible seq * ?ShowMarkers: bool * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'c * ?MultiText: 'c seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'c :> System.IConvertible)
<summary> Creates a polar line plot. LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a line. </summary>
<param name="r">Sets the radial coordinates of the plotted data</param>
<param name="theta">Sets the angular coordinates of the plotted data</param>
<param name="ShowMarkers">Whether to show markers for the datums additionally to the line</param>
<param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
<param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
<param name="Opacity">Sets the opactity of the trace</param>
<param name="MultiOpacity">Sets the opactity of individual datum markers</param>
<param name="Text">Sets a text associated with each datum</param>
<param name="MultiText">Sets individual text for each datum</param>
<param name="TextPosition">Sets the position of text associated with each datum</param>
<param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
<param name="MarkerColor">Sets the color of the marker</param>
<param name="MarkerColorScale">Sets the colorscale of the marker</param>
<param name="MarkerOutline">Sets the outline of the marker</param>
<param name="MarkerSymbol">Sets the marker symbol for each datum</param>
<param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
<param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
<param name="LineColor">Sets the color of the line</param>
<param name="LineColorScale">Sets the colorscale of the line</param>
<param name="LineWidth">Sets the width of the line</param>
<param name="LineDash">sets the drawing style of the line</param>
<param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
<param name="UseWebGL">If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once.</param>
<param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
<summary> Plotly color can be a single color, a sequence of colors, or a sequence of numeric values referencing the color of the colorscale obj </summary>
<summary> Dash: Sets the drawing style of the lines segments in this trace. Sets the style of the lines. Set to a dash string type or a dash length in px. </summary>
static member Chart.SplinePolar: rEncoded: EncodedTypedArray * thetaEncoded: EncodedTypedArray * ?ShowMarkers: bool * ?Smoothing: float * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'a * ?MultiText: 'a seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a :> System.IConvertible)
static member Chart.SplinePolar: r: #System.IConvertible seq * theta: #System.IConvertible seq * ?ShowMarkers: bool * ?Smoothing: float * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: float seq * ?Text: 'c * ?MultiText: 'c seq * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: StyleParam.TextPosition seq * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol3D * ?MultiMarkerSymbol: StyleParam.MarkerSymbol3D seq * ?Marker: TraceObjects.Marker * ?LineColor: Color * ?LineColorScale: StyleParam.Colorscale * ?LineWidth: float * ?LineDash: StyleParam.DrawingStyle * ?Line: Line * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'c :> System.IConvertible)
<summary> Creates a polar spline plot. LinePolar plots plot two-dimensional data on a polar coordinate system comprised of angular and radial position scales connected via a smoothed line. </summary>
<param name="r">Sets the radial coordinates of the plotted data</param>
<param name="theta">Sets the angular coordinates of the plotted data</param>
<param name="ShowMarkers">Whether to show markers for the datums additionally to the line</param>
<param name="Smoothing">Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3</param>
<param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
<param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
<param name="Opacity">Sets the opactity of the trace</param>
<param name="MultiOpacity">Sets the opactity of individual datum markers</param>
<param name="Text">Sets a text associated with each datum</param>
<param name="MultiText">Sets individual text for each datum</param>
<param name="TextPosition">Sets the position of text associated with each datum</param>
<param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
<param name="MarkerColor">Sets the color of the marker</param>
<param name="MarkerColorScale">Sets the colorscale of the marker</param>
<param name="MarkerOutline">Sets the outline of the marker</param>
<param name="MarkerSymbol">Sets the marker symbol for each datum</param>
<param name="MultiMarkerSymbol">Sets the marker symbol for each individual datum</param>
<param name="Marker">Sets the marker (use this for more finegrained control than the other marker-associated arguments)</param>
<param name="LineColor">Sets the color of the line</param>
<param name="LineColorScale">Sets the colorscale of the line</param>
<param name="LineWidth">Sets the width of the line</param>
<param name="LineDash">sets the drawing style of the line</param>
<param name="Line">Sets the line (use this for more finegrained control than the other line-associated arguments)</param>
<param name="UseWebGL">If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once.</param>
<param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
<summary> Sets the positions of the `text` elements. Note that not all options work for every type of trace, e.g. Pie Charts only support "inside" | "outside" | "auto" | "none" - Cartesian plots: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - Pie Charts and derivatives: Specifies the location of the text with respects to the sector. </summary>
Plotly.NET